close
大概上網看了一下Plugin用意:
Plugin 樣版: 其實指的就是下方$.fn.mytoolbox的使用
mytest.ja
(function( $ ){
$.fn.mytest = function() {
return this.each(function() {
alert("this.innerHTML:"+this.innerHTML);
});(Plugin 內容)
};
})
index.html
<html>
<head>
<title></title>
<meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
<script type="text/javascript" src="jquery.js"></script>
<script type="text/javascript" src="mytest.js"></script>
<script>
$(document).ready( function() {
$('#myDIV').mytest();
})
</script>
</head>
<body>
<div id="myDIV">Hello jQuery Plugin</div>
</body>
</html>
全站熱搜