如何将插件中的以下属性/变量转换为可以从文档准备好的默认值和选项?
// 插件 js:
(function($){
$.fn.myPlugin = function(options){
var myForm = this;
myForm.variable1 = true;
myForm.variable2 = true;
myForm.variable3 = true;
myForm.variable4 = true;
...
if(myForm.variable1){
// do something
}
...
}
})(jQuery);
// 文档在页面中准备就绪:
<script type="text/javascript">
$(document).ready(function() {
$('#form1').myPlugin();
});
</script>