jQuery:自定义函数

<!doctype html>
<html>
<head>
<meta charset="utf-8">
<title></title>
<!--引入jQuery-->
<script src="js/jquery.min.js" type="text/javascript"></script>
<script>
(function ($) {
//函数定义
$.getUrl = function (name) {
//函数内容
}
})(jQuery);

$(document).ready(function(){
//函数调用
$.getUrl('aim');
});
</script>
</head>

<body>
</body>
</html>
---------------------
作者:Siimple
来源:CSDN
原文:https://blog.csdn.net/m0_37826101/article/details/79480906
版权声明:本文为博主原创文章,转载请附上博文链接!

猜你喜欢

转载自www.cnblogs.com/Jeely/p/10714937.html