标签:
1.javascript 选项散列对象
function Test(p1,p2,p3,p4,p5){
//do something
}
call:
参数可选
Test({
p1:value1,
p2:value2,
p5:value5
});
2. self-definition function
Test(options){
var settings = $.extend({
p1:value1,
p2:value2,
p3:value3,
p4:value4,
p5:value5
},options||{});
//do something
}
jquery function Optional Arguments
标签:
原文地址:http://www.cnblogs.com/rocky-fang/p/5235777.html