JQ fn扩展方法

Posted THE BEST GIFT

tags:

篇首语:本文由小常识网(cha138.com)小编为大家整理,主要介绍了JQ fn扩展方法相关的知识,希望对你有一定的参考价值。

<!doctype html>
<html lang="en">
<head>
<meta charset="UTF-8">
<title>Document</title>
</head>
<body>
<span>click here</span>
<script type="text/javascript" src="http://s.thsi.cn/cb?js/;jquery-1.8.3.min.js"></script>
<script>
$.fn.extend({
showName:function(){
$(this).click(function(){
alert($(this).html());
});
}
});
$("span").showName();
</script>
</body>
</html>

以上是关于JQ fn扩展方法的主要内容,如果未能解决你的问题,请参考以下文章

JQ插件机制

jq库extend的区别

JQ源码分析(2.0.3)---$.extend() $.fn.extend()

jQuery easyui 扩展form插件的三个方法

挂号平台首页开发(UI组件部分)

jQuery的extend方法