{"id":52510,"date":"2024-12-03T16:30:24","date_gmt":"2024-12-03T08:30:24","guid":{"rendered":"https:\/\/fwq.ai\/blog\/52510\/"},"modified":"2024-12-03T16:30:24","modified_gmt":"2024-12-03T08:30:24","slug":"jquery-%e4%b8%ad%e5%a6%82%e4%bd%95%e8%8e%b7%e5%8f%96%e5%af%b9%e8%b1%a1%e7%b1%bb%e5%9e%8b%e5%ad%97%e7%ac%a6%e4%b8%b2%ef%bc%9f","status":"publish","type":"post","link":"https:\/\/fwq.ai\/blog\/52510\/","title":{"rendered":"jQuery \u4e2d\u5982\u4f55\u83b7\u53d6\u5bf9\u8c61\u7c7b\u578b\u5b57\u7b26\u4e32\uff1f"},"content":{"rendered":"<p><b><\/b>     <\/p>\n<h1>jQuery \u4e2d\u5982\u4f55\u83b7\u53d6\u5bf9\u8c61\u7c7b\u578b\u5b57\u7b26\u4e32\uff1f<\/h1>\n<p>\u4f60\u5728\u5b66\u4e60<span style=\"color: #FF6600;, Helvetica, Arial, sans-serif;font-size: 14px;background-color: #FFFFFF\">\u6587\u7ae0<\/span>\u76f8\u5173\u7684\u77e5\u8bc6\u5417\uff1f\u672c\u6587<span style=\"color: #FF6600;, Helvetica, Arial, sans-serif;font-size: 14px;background-color: #FFFFFF\">\u300ajQuery \u4e2d\u5982\u4f55\u83b7\u53d6\u5bf9\u8c61\u7c7b\u578b\u5b57\u7b26\u4e32\uff1f\u300b<\/span>\uff0c\u4e3b\u8981\u4ecb\u7ecd\u7684\u5185\u5bb9\u5c31\u6d89\u53ca\u5230<span style=\"color: #FF6600;, Helvetica, Arial, sans-serif;font-size: 14px;background-color: #FFFFFF\"><\/span>\uff0c\u5982\u679c\u4f60\u60f3\u63d0\u5347\u81ea\u5df1\u7684\u5f00\u53d1\u80fd\u529b\uff0c\u5c31\u4e0d\u8981\u9519\u8fc7\u8fd9\u7bc7\u6587\u7ae0\uff0c\u5927\u5bb6\u8981\u77e5\u9053\u7f16\u7a0b\u7406\u8bba\u57fa\u7840\u548c\u5b9e\u6218\u64cd\u4f5c\u90fd\u662f\u4e0d\u53ef\u6216\u7f3a\u7684\u54e6\uff01<\/p>\n<p><img decoding=\"async\" src=\"https:\/\/www.17golang.com\/uploads\/20241121\/1732155899673e99fb7db86.jpg\" class=\"aligncenter\" title=\"jQuery \u4e2d\u5982\u4f55\u83b7\u53d6\u5bf9\u8c61\u7c7b\u578b\u5b57\u7b26\u4e32\uff1f\u63d2\u56fe\" alt=\"jQuery \u4e2d\u5982\u4f55\u83b7\u53d6\u5bf9\u8c61\u7c7b\u578b\u5b57\u7b26\u4e32\uff1f\u63d2\u56fe\" \/><\/p>\n<p><strong>\u6df1\u5165\u7406\u89e3 jquery \u83b7\u53d6\u5bf9\u8c61\u7c7b\u578b\u5b57\u7b26\u4e32\u7684\u4ee3\u7801<\/strong><\/p>\n<p>\u4e3a\u4e86\u66f4\u597d\u5730\u7406\u89e3 jquery \u4e2d\u83b7\u53d6\u5bf9\u8c61\u7c7b\u578b\u5b57\u7b26\u4e32\u7684\u65b9\u6cd5\uff0c\u8ba9\u6211\u4eec\u6df1\u5165\u7814\u7a76\u5176\u4e2d\u4e0d\u719f\u6089\u7684\u4ee3\u7801\u90e8\u5206\u3002<\/p>\n<p><strong>\u95ee\u9898\u89e3\u6790\uff1atostring.call( obj ) \u7684\u4f5c\u7528<\/strong><\/p>\n<p>\u5728\u4ee3\u7801 class2type[ tostring.call( obj ) ] \u4e2d\uff0ctostring.call( obj ) \u7684\u4f5c\u7528\u662f\u83b7\u53d6\u5bf9\u8c61\u7684\u7c7b\u578b\u5b57\u7b26\u4e32\u3002\u5177\u4f53\u6765\u8bf4\uff0c\u5b83\u901a\u8fc7\u8c03\u7528\u5bf9\u8c61\u7684 tostring \u65b9\u6cd5\uff0c\u5e76\u4f20\u9012\u5f53\u524d\u5bf9\u8c61\u4f5c\u4e3a\u53c2\u6570\uff0c\u6765\u83b7\u5f97\u5bf9\u8c61\u7684\u7c7b\u578b\u5b57\u7b26\u4e32\u3002<\/p>\n<p><strong>\u7b54\u6848\u91ca\u7591\uff1aclass2type.tostring = object.prototype.tostring<\/strong><\/p>\n<p>\u7136\u800c\uff0c\u5728\u7ed9\u51fa\u7684\u4ee3\u7801\u7247\u6bb5\u4e2d\uff0cclass2type.tostring \u6ca1\u6709\u5b9a\u4e49\u3002\u8fd9\u8868\u660e class2type[ tostring.call( obj ) ] \u7684\u5b9e\u9645\u4e0a\u542b\u4e49\u5982\u4e0b\uff1a<\/p>\n<pre>object.prototype.tostring.call( obj )<\/pre>\n<p>\u6b64\u4ee3\u7801\u5c06\u8fd4\u56de\u5bf9\u8c61\u7684\u7c7b\u578b\u5b57\u7b26\u4e32\u3002\u4f8b\u5982\uff1a<\/p>\n<pre>Object.prototype.toString.call( 10 ) \/\/ \"[object Number]\"\nObject.prototype.toString.call( 'string' ) \/\/ \"[object String]\"\nObject.prototype.toString.call( [] ) \/\/ \"[object Array]\"<\/pre>\n<p>\u7406\u8bba\u8981\u638c\u63e1\uff0c\u5b9e\u64cd\u4e0d\u80fd\u843d\uff01\u4ee5\u4e0a\u5173\u4e8e\u300ajQuery \u4e2d\u5982\u4f55\u83b7\u53d6\u5bf9\u8c61\u7c7b\u578b\u5b57\u7b26\u4e32\uff1f\u300b\u7684\u8be6\u7ec6\u4ecb\u7ecd\uff0c\u5927\u5bb6\u90fd\u638c\u63e1\u4e86\u5427\uff01\u5982\u679c\u60f3\u8981\u7ee7\u7eed\u63d0\u5347\u81ea\u5df1\u7684\u80fd\u529b\uff0c\u90a3\u4e48\u5c31\u6765\u5173\u6ce8\u7c73\u4e91\u516c\u4f17\u53f7\u5427\uff01<\/p>\n<dl>\n<dt><\/dt>\n<dd>\n   \u521b\u5efa\u4e13\u6ce8\u7684\u9886\u57df\u5e94\u7528\u7a0b\u5e8f Symfony \u65b9\u6cd5\uff08\u4fdd\u5b58\u5b9e\u4f53\uff09\n <\/dd>\n<\/dl>\n","protected":false},"excerpt":{"rendered":"<p>jQuery \u4e2d\u5982\u4f55\u83b7\u53d6\u5bf9\u8c61\u7c7b\u578b\u5b57\u7b26\u4e32\uff1f \u4f60\u5728\u5b66\u4e60\u6587\u7ae0\u76f8\u5173\u7684\u77e5\u8bc6\u5417\uff1f\u672c\u6587\u300ajQuery \u4e2d\u5982\u4f55\u83b7\u53d6\u5bf9\u8c61\u7c7b\u578b\u5b57\u7b26\u4e32\uff1f\u300b\uff0c\u4e3b\u8981\u4ecb\u7ecd\u7684\u5185\u5bb9\u5c31\u6d89\u53ca\u5230\uff0c\u5982\u679c\u4f60\u60f3\u63d0\u5347\u81ea\u5df1\u7684\u5f00\u53d1\u80fd\u529b\uff0c\u5c31\u4e0d\u8981\u9519\u8fc7\u8fd9\u7bc7\u6587\u7ae0\uff0c\u5927\u5bb6\u8981\u77e5\u9053\u7f16\u7a0b\u7406\u8bba\u57fa\u7840\u548c\u5b9e\u6218\u64cd\u4f5c\u90fd\u662f\u4e0d\u53ef\u6216\u7f3a\u7684\u54e6\uff01 \u6df1\u5165\u7406\u89e3 jquery \u83b7\u53d6\u5bf9\u8c61\u7c7b\u578b\u5b57\u7b26\u4e32\u7684\u4ee3\u7801 \u4e3a\u4e86\u66f4\u597d\u5730\u7406\u89e3 jquery \u4e2d\u83b7\u53d6\u5bf9\u8c61\u7c7b\u578b\u5b57\u7b26\u4e32\u7684\u65b9\u6cd5\uff0c\u8ba9\u6211\u4eec\u6df1\u5165\u7814\u7a76\u5176\u4e2d\u4e0d\u719f\u6089\u7684\u4ee3\u7801\u90e8\u5206\u3002 \u95ee\u9898\u89e3\u6790\uff1atostring.call( obj ) \u7684\u4f5c\u7528 \u5728\u4ee3\u7801 class2type[ tostring.call( obj ) ] \u4e2d\uff0ctostring.call( obj ) \u7684\u4f5c\u7528\u662f\u83b7\u53d6\u5bf9\u8c61\u7684\u7c7b\u578b\u5b57\u7b26\u4e32\u3002\u5177\u4f53\u6765\u8bf4\uff0c\u5b83\u901a\u8fc7\u8c03\u7528\u5bf9\u8c61\u7684 tostring \u65b9\u6cd5\uff0c\u5e76\u4f20\u9012\u5f53\u524d\u5bf9\u8c61\u4f5c\u4e3a\u53c2\u6570\uff0c\u6765\u83b7\u5f97\u5bf9\u8c61\u7684\u7c7b\u578b\u5b57\u7b26\u4e32\u3002 \u7b54\u6848\u91ca\u7591\uff1aclass2type.tostring = object.prototype.tostring \u7136\u800c\uff0c\u5728\u7ed9\u51fa\u7684\u4ee3\u7801\u7247\u6bb5\u4e2d\uff0cclass2type.tostring \u6ca1\u6709\u5b9a\u4e49\u3002\u8fd9\u8868\u660e class2type[ tostring.call( obj ) ] \u7684\u5b9e\u9645\u4e0a\u542b\u4e49\u5982\u4e0b\uff1a object.prototype.tostring.call( obj ) \u6b64\u4ee3\u7801\u5c06\u8fd4\u56de\u5bf9\u8c61\u7684\u7c7b\u578b\u5b57\u7b26\u4e32\u3002\u4f8b\u5982\uff1a Object.prototype.toString.call( 10 ) \/\/ &#8220;[object Number]&#8221; Object.prototype.toString.call( &#8216;string&#8217; ) \/\/ &#8220;[object String]&#8221; Object.prototype.toString.call( [] [&hellip;]<\/p>\n","protected":false},"author":1,"featured_media":0,"comment_status":"closed","ping_status":"","sticky":false,"template":"","format":"standard","meta":{"footnotes":""},"categories":[16],"tags":[],"class_list":["post-52510","post","type-post","status-publish","format-standard","hentry","category-16"],"_links":{"self":[{"href":"https:\/\/fwq.ai\/blog\/wp-json\/wp\/v2\/posts\/52510","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/fwq.ai\/blog\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/fwq.ai\/blog\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/fwq.ai\/blog\/wp-json\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/fwq.ai\/blog\/wp-json\/wp\/v2\/comments?post=52510"}],"version-history":[{"count":0,"href":"https:\/\/fwq.ai\/blog\/wp-json\/wp\/v2\/posts\/52510\/revisions"}],"wp:attachment":[{"href":"https:\/\/fwq.ai\/blog\/wp-json\/wp\/v2\/media?parent=52510"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/fwq.ai\/blog\/wp-json\/wp\/v2\/categories?post=52510"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/fwq.ai\/blog\/wp-json\/wp\/v2\/tags?post=52510"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}