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>

arrow
arrow
    全站熱搜
    創作者介紹
    創作者 JoshS 的頭像
    JoshS

    JoshS的部落格

    JoshS 發表在 痞客邦 留言(0) 人氣()