1
假設我們需要動態地構建插件調用如調用動態jQuery插件動態參數在Javascript
$('#myDiv').myPlugin({a:'a',b:'b'});
將是這樣的:
function funcCallBuilder(selector, func, opts){
//dynamically construct plugin call here
}
使用:
funcCallBuilder('#myDiv', 'myPlugin', {a:'a',b:'b'});
有人能指出正確的做法嗎?
問得好+ 1個 – 2011-05-16 21:52:08