{"id":4251,"date":"2015-10-26T10:08:19","date_gmt":"2015-10-26T02:08:19","guid":{"rendered":"https:\/\/sdeno.com\/?p=4251"},"modified":"2017-11-19T20:24:10","modified_gmt":"2017-11-19T12:24:10","slug":"jquery%e8%a7%a3%e5%89%96","status":"publish","type":"post","link":"https:\/\/sdeno.com\/?p=4251","title":{"rendered":"jquery\u89e3\u5256"},"content":{"rendered":"<p>\u4ee5\u4e0b\u7684\u6587\u4ef6\u90fd\u8981\u770bhtml\u7684\u6e90\u7801\u00a0 \u00a0jquery \u89e3\u5256 \u6e90\u7801\u89e3\u6790 \u00a0jquery\u89e3\u6790<\/p>\n<p>1\uff0c\u4e3a\u4ec0\u4e48\u6211\u4eec\u80fd\u7528$().css()\u7c7b\u4f3c\u8fd9\u6837\u7684\u65b9\u6cd5\u53bb\u5199\u4ee3\u7801\u5462\uff1f<\/p>\n<p><a href=\"https:\/\/sdeno.com\/wp-content\/uploads\/2015\/10\/am.html\">am<\/a><\/p>\n<blockquote class=\"wp-embedded-content\" data-secret=\"enZB5eZIld\"><p><a href=\"https:\/\/sdeno.com\/?p=4873\">1\u3001jQuery\u603b\u4f53\u8f6e\u5ed3<\/a><\/p><\/blockquote>\n<p><iframe loading=\"lazy\" class=\"wp-embedded-content\" sandbox=\"allow-scripts\" security=\"restricted\" style=\"position: absolute; visibility: hidden;\" title=\"\u300a1\u3001jQuery\u603b\u4f53\u8f6e\u5ed3\u300b\u2014\u968f\u8eab\u7b14\u8bb0\" src=\"https:\/\/sdeno.com\/?p=4873&#038;embed=true#?secret=g0Jq3Nnppw#?secret=enZB5eZIld\" data-secret=\"enZB5eZIld\" width=\"500\" height=\"282\" frameborder=\"0\" marginwidth=\"0\" marginheight=\"0\" scrolling=\"no\"><\/iframe><\/p>\n<p>&nbsp;<\/p>\n<p><a href=\"https:\/\/sdeno.com\/wp-content\/uploads\/2015\/10\/am2.html\">am2<\/a><\/p>\n<p>\u63a8\u8350\u770b\u4ee5\u4e0b\uff1a<\/p>\n<pre>   \r\n\t  (function(window,undefind){  \/\/\u7b2c\u4e00\u53c2\u6570\u662fwindow\u5168\u5c40\u5bf9\u8c61\u3002\u7b2c\u4e8c\u53c2\u6570\u662fundefind\uff0c\u4f46\u504f\u504f\u4e0d\u7ed9\u5b83\u8d4b\u503c\uff0c\u56e0\u4e3a\u4e0d\u540c\u6d4f\u89c8\u5668\u662f\u53ef\u4ee5\u4fee\u6539undefind\u7684\u503c\u7684\uff0c\u4e0d\u7ed9\u5b83\u4f20\u503c\u662f\u4e3a\u4e86\u4fdd\u8bc1undefind\u7684\u503c\u5c31\u662fundefind\r\n             \r\n              var jQuery=function(){  \/\/\u6b64\u51fd\u6570\u662f\u81ea\u8c03\u7528\uff0c\u91cc\u9762\u7684\u4ee3\u7801\u4f1a\u88ab\u81ea\u52a8\u6267\u884c\u3002\u5982\u679c\u6b64\u51fd\u6570\u88ab\u8c03\u7528jQuery()\u76f8\u5f53\u4e8e\u6267\u884c\u4e86new jQuery.fn.init(selector,context)\r\n\r\n               \r\n                    var jQuery=function(selector,context){   \/\/\u58f0\u660e\u4e00\u4e2ajQuery\u51fd\u6570\r\n                        return new jQuery.fn.init(selector,context);  \/\/\u6211\u4eec\u5e73\u65f6\u5199\u7684$() ,\u5176\u5b9e\u5c31\u662f\u8c03\u7528\u8fd9\u91cc\u6240\u8fd4\u56de\u7ed9\u6211\u4eec\u7684\r\n                    };\r\n                  \r\n                    jQuery.fn=jQuery.prototype={ \/\/\u5728jquery\u7684\u539f\u578b\u5bf9\u8c61\u4e0a\u6269\u5c55\u65b9\u6cd5\u548c\u5c5e\u6027 \uff0c\u57fa\u672c\u7528\u6cd5\u90fd\u662f$().xx()\r\n                       constructor:jQuery,  \/\/\u8981\u4f7f\u7528\u5b57\u9762\u91cf\u7684\u4e66\u5199\u65b9\u5f0f\u7ed9\u539f\u578b\u5bf9\u8c61\u6dfb\u52a0\u5c5e\u6027\u548c\u65b9\u6cd5\uff0c\u5c31\u8981constructor\u5c5e\u6027\u6765\u6307\u5b9a\u6784\u9020\u51fd\u6570\uff0c\u4e0d\u7136\u662f\u627e\u4e0d\u5230\u7684\r\n                       init:function(){},\r\n                       jquery:\"1.7.1\",\r\n                       eq:function(){},\r\n                       size:function(){}\r\n                       \/\/...\r\n                    };\r\n              \r\n                 \r\n\r\n\r\n                    jQuery.fn.init.prototype=jQuery.fn;  \/\/\u53ea\u9700\u8981\u7406\u89e3\uff0c\u8001\u7238\u7ed9\u8d22\u4ea7\u513f\u5b50\uff0c\u513f\u5b50\u7ee7\u627f\u8001\u7238\u8d22\u4ea7\u3002\u4ee5\u540e\u53ea\u8981\u5728\u8001\u7238\u8eab\u4e0a\u6dfb\u52a0\u5c5e\u6027\u548c\u65b9\u6cd5\u81ea\u7136\u513f\u5b50\u4e5f\u5c31\u6709\u8001\u7238\u7684\u5c5e\u6027\u548c\u65b9\u6cd5\u4e86\r\n\r\n\r\n                    jQuery.extend=jQuery.fn.extend=function(){ \r\n                                    this['xx']=arguments[0].xx\r\n                                    this['yy']=arguments[0].yy\r\n                                    \/\/ Return the modified object\r\n                                    return this;\r\n                     }  \/\/\u540c\u65f6\u5728jquery\u6784\u9020\u51fd\u6570\u548cjquery\u539f\u578b\u5bf9\u8c61\u6dfb\u52a0\u540c\u6837\u7684\u65b9\u6cd5extend\r\n\r\n\r\n\r\n                    jQuery.extend({  \/\/\u76f8\u5f53\u4e8e\u5728jquery\u8fd9\u4e2a\u6784\u9020\u51fd\u6570\u4e0a\u6dfb\u52a0\u5c5e\u6027\u548c\u65b9\u6cd5\uff0c\u8c03\u7528\u57fa\u672c\u662f$.xx()\u3002\u5982\u679c\u662f\u57fa\u4e8ejQuery.fn.extend\u6269\u5c55\u7684\u8bdd\uff0c\u5c31\u76f8\u5f53\u4e8e\u4e3ajQuery\u6269\u5c55\u529f\u80fd\u4e86\uff0c\u4e00\u822c\u8c03\u7528\u90fd\u662f$().xx()\r\n                          xx:function(){ document.title=document.title+'1111'+$().jquery },\r\n                          yy:function(){ document.title=document.title+'yyyy' },\r\n                          ajax:function(){}\r\n                    });\r\n\r\n\r\n                    return jQuery;\r\n              }();  \/\/\u7ed3\u679c\u662f jQuery = jQuery;\r\n\r\n             \r\n              window.jQuery=window.$=jQuery   \/\/\u628ajquery\u51fd\u6570\u8d4b\u503c\u7ed9window.jQuery\u548cwindow.$;\u8fd9\u91cc\u7684jQuery\u5176\u5b9e\u5c31\u662freturn jQuery\uff0c\u4e00\u65e6jQuery()\u5c31\u76f8\u5f53\u4e8enew jQuery.fn.init(selector,context)\r\n\t })(window);  \/\/\u5c06window\u5bf9\u8c61\u4f20\u5165\uff0c\u533f\u540d\u51fd\u6570\u4e2d\uff0c\u514d\u5f97\u53bb\u627e\u7701\u65f6\u95f4\r\n\r\n      $() \/\/\u76f8\u5f53\u4e8e\u6267\u884c\u4e86jQuery() \uff0c\u53c8\u76f8\u5f53\u4e8e\u6267\u884c\u4e86 new jQuery.fn.init(selector,context)\r\n\r\n\r\n\r\n<\/pre>\n","protected":false},"excerpt":{"rendered":"<p>\u4ee5\u4e0b\u7684\u6587\u4ef6\u90fd\u8981\u770bhtml\u7684\u6e90\u7801\u00a0 \u00a0jquery \u89e3\u5256 \u6e90\u7801\u89e3\u6790 \u00a0jquery\u89e3\u6790 1\uff0c\u4e3a\u4ec0\u4e48\u6211\u4eec\u80fd\u7528$() [&hellip;]<\/p>\n","protected":false},"author":1,"featured_media":0,"comment_status":"closed","ping_status":"closed","sticky":false,"template":"","format":"standard","meta":{"footnotes":""},"categories":[11],"tags":[],"class_list":["post-4251","post","type-post","status-publish","format-standard","hentry","category-11"],"_links":{"self":[{"href":"https:\/\/sdeno.com\/index.php?rest_route=\/wp\/v2\/posts\/4251","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/sdeno.com\/index.php?rest_route=\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/sdeno.com\/index.php?rest_route=\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/sdeno.com\/index.php?rest_route=\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/sdeno.com\/index.php?rest_route=%2Fwp%2Fv2%2Fcomments&post=4251"}],"version-history":[{"count":0,"href":"https:\/\/sdeno.com\/index.php?rest_route=\/wp\/v2\/posts\/4251\/revisions"}],"wp:attachment":[{"href":"https:\/\/sdeno.com\/index.php?rest_route=%2Fwp%2Fv2%2Fmedia&parent=4251"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/sdeno.com\/index.php?rest_route=%2Fwp%2Fv2%2Fcategories&post=4251"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/sdeno.com\/index.php?rest_route=%2Fwp%2Fv2%2Ftags&post=4251"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}