Juqery插件编写 基础说明
<!DOCTYPE html> <html> <head> <meta name="viewport" content="width=device-width" /> <title>Index3</title> <script src="/plugins/jquery/jquery-1.9.1.js"></script> <script type="text/javascript"> $(function ($) { // 去除冲突 // 实现$("#txt1").SpecialAlertTip({ width: 300 }); $.fn.SpecialAlertTip = function (options) { var settings = { width: 100, defalutText: "It is Default", placeholder: 'Hello Jquery pulgIn', showSearch: true, } // 合并 两个js对象 $.extend({name:1,width:23},{width:55}); settings = $.extend(settings, options); /** * Constructor */ function SpecialAlertTip(select, settings) { debugger; this