- 结构目录
- myPlugin.js
$.fn.myPlugin = function(options){
var set = $.extend({
leftContent: "leftContent",
url:""
},options);
var $target = this;
console.log(set.url);
}
})(jQuery)
- index.html 页面使用
<script type="text/javascript" src="js/jquery-1.12.4.min.js"></script>
<script type="text/javascript" src="js/myPlugin.js"></script>
<script type="text/javascript">
$(function(){
$("id_tableSet").myPlugin({
url:"12321312"
})
});
</script>