/*step by step to get Script

Wolke Lin 2009.1201*/

$.fn.getScripts=function(jss,callback)
{
var index=0;
function step()
{
if(jss[index]!=null)
{$.getScript(jss[index],function(){step()});}
else
{callback();}
index+=1;
}
step();
}

 

我在引用jqgrid時發現jquery沒有getScripts

是的,我要一個s(複數)

因為用google.load完後,

還要再載入jqgrid的library

如果寫成

This is what  I write for Jquery , because jquery does not have getScripts(plural) , but I need it , so I create one If you need it , just take it , and appoint it to my blog ,thx


$.getscript(xxx,function({

$.getscript(ooo,function({


}))

}))

以此類推 看起來就會很蠢

所以寫一個簡單的plugin 有需要的朋友拿去用吧!

arrow
arrow
    全站熱搜

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