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
}
时间: 2024-10-03 01:24:50