close

1. 使用字串帶入
    var a = 456;
    setTimeout("alert(" + a + ")", 1000);

2. 使用把 function 當變數帶入
    var a = 456;
    setTimeout((function(x)
    {
        alert(x);
    })(a), 1000);            

arrow
arrow
    全站熱搜

    wbkuo 發表在 痞客邦 留言(0) 人氣()