- var func = function(options) {
- options = $.extend({
- attribute1: default_value1,
- attribute2: default_value2,
- attribute3: default_value3,
- attribute4: default_value4
- }, options || {});
- // ...
- };
- //该片段来自于http://www.codesnippet.cn/detail/100320148928.html
来源: http://www.codesnippet.cn/detail/100320148928.html