{"id":260,"date":"2012-09-17T18:13:10","date_gmt":"2012-09-17T10:13:10","guid":{"rendered":"http:\/\/www.withonly.com\/?p=260"},"modified":"2012-09-17T18:13:10","modified_gmt":"2012-09-17T10:13:10","slug":"vs-2012-%e4%b8%adjs%e7%9a%84intellisense%e6%99%ba%e8%83%bd%e6%8f%90%e7%a4%ba","status":"publish","type":"post","link":"https:\/\/blog.5danyuan.com\/?p=260","title":{"rendered":"vs 2012 \u4e2djs\u7684intellisense\u667a\u80fd\u63d0\u793a"},"content":{"rendered":"<p>\u5728\u524d\u9762\u7684\u535a\u5ba2\u91cc\u63d0\u53ca Visual Studio 2012 RTM \u5df2\u7ecf\u51fa\u6765\u6709\u4e00\u6bb5\u65f6\u95f4\u4e86\uff0c\u5728 vs \u4ee5\u524d\u7684\u7248\u672c\u91cc\uff0c\u5bf9\u4e8e\u7528\u6237\u7684\u667a\u80fd\u63d0\u793a\u505a\u7684\u8fd8\u4e0d\u591f\u597d\uff0c\u5728 2012 \u7684\u7248\u672c\u91cc\u5927\u6709\u6539\u5584\uff0c\u4eca\u5929\u6211\u4eec\u8981\u5206\u4eab\u7684\u662f\u5982\u4f55\u5728\u00a0 vs 2012 \u91cc\u4f7f\u7528\u7528\u6237 js \u7684 intellisense \u667a\u80fd\u63d0\u793a\u3002<\/p>\n<p>\u4f7f\u7528\u8d77\u6765\u8fd8\u662f\u5f88\u7b80\u5355\u7684\uff0c\u6bd4\u5982\u8bf4\u9879\u76ee\u4e2d\u6709\u4e2a common.js \u6587\u4ef6\uff0c\u8fd9\u4e2a\u65f6\u5019\u53ea\u9700\u8981\u6dfb\u52a0\u4e00\u4e2a\u540d\u4e3a\u00a0 common.intellisense.js \u7684\u6587\u4ef6\u5c31\u53ef\u4ee5\u4e86\u3002IDE \u53ef\u4ee5\u81ea\u52a8\u53d1\u73b0\uff0c\u5728\u5f00\u59cb\u7684\u65f6\u5019\u6211\u8fd8\u4e0d\u6e05\u695a\uff0c\u4e13\u95e8\u5728\u9875\u9762\u91cc\u5f15\u7528\u4e86\u4e0b\uff0c\u7ed3\u679c\u8fd0\u884c\u65f6\u603b\u62a5\u544a\u9519\u8bef\uff0c\u540e\u6765\u624d\u53d1\u73b0\u8fd9\u4e2a\u6280\u5de7\u3002<\/p>\n<p>\u573a\u666f\uff1a\u5728common.js \u6587\u4ef6\u91cc\u6709\u4e00\u4e2a load \u65b9\u6cd5\uff0c\u67092\u4e2a\u53c2\u6570 \uff0c\u683c\u5f0f\u5982\u4e0b\uff1a<\/p>\n<p>function load(url,charset){}<\/p>\n<p>\u8981\u5b9e\u73b0 intellisense \u667a\u80fd\u63d0\u793a\uff0c\u6211\u4eec\u53ea\u9700\u8981\u5728 common.intellisense.js \u6587\u4ef6\u91cc\u6dfb\u52a0\u4e0b\u9762\u7684\u65b9\u6cd5\u5373\u53ef\uff1a<\/p>\n<p>intellisense.annotate(window,{ \u00a0\u00a0\u00a0 &#8220;load&#8221;:function(){<br \/>\n\/\/\/ &lt;signature&gt;<br \/>\n\/\/\/\u00a0\u00a0 &lt;summary&gt;\u52a0\u8f7d js \u6587\u4ef6&lt;\/summary&gt;<br \/>\n\/\/\/\u00a0\u00a0 &lt;param name=&#8221;url&#8221; type=&#8221;String&#8221;&gt;js \u6587\u4ef6\u7684\u8def\u5f84&lt;\/param&gt;<br \/>\n\/\/\/\u00a0\u00a0 &lt;param name=&#8221;charset&#8221; type=&#8221;String&#8221;&gt;js \u6587\u4ef6\u7684\u5b57\u7b26\u7f16\u7801\uff0c\u4f8b\u5982 utf-8&lt;\/param&gt;<br \/>\n\/\/\/\u00a0\u00a0 &lt;returns type=&#8221;Object&#8221; \/&gt;<br \/>\n\/\/\/ &lt;\/signature&gt; }, });<\/p>\n<p>\u7b80\u5355\u5730\u8bf4\uff0c\u6211\u4eec\u53ea\u9700\u8981\u5b8c\u5584 intellisense.annotate \u65b9\u6cd5\u5373\u53ef\uff0c\u8be5\u65b9\u6cd5\u63a5\u53d7 2 \u4e2a\u53c2\u6570\uff0c\u7b2c\u4e00\u4e2a\u53c2\u6570\u4e3a\u60f3\u8981\u8fdb\u884c\u667a\u80fd\u63d0\u793a\u7684\u5bf9\u8c61\uff0c\u793a\u4f8b\u4e2d\u4f7f\u7528\u7684\u662f window \u5bf9\u8c61\uff0c\u4e5f\u53ef\u4ee5\u662f\u5176\u5b83\u7684\u5bf9\u8c61\uff1b\u7b2c\u4e8c\u4e2a\u53c2\u6570\u662f\u4e00\u4e2a json \u5bf9\u8c61\uff0c\u4f20\u9012\u7684\u662f\u667a\u80fd\u63d0\u793a\u7684\u53c2\u6570\u5217\u8868\u3002<\/p>\n<p>\u667a\u80fd\u63d0\u793a\u4ee5 signature \u5305\u542b\uff0c\u5e38\u89c1\u7684\u6709 3\u4e2a\uff0csummary \u63cf\u8ff0\u7684\u662f\u8be5\u65b9\u6cd5\u7684\u529f\u80fd\uff1bparam \u662f\u5177\u4f53\u6bcf\u4e00\u4e2a\u53c2\u6570\u7684\u63cf\u8ff0\uff0c\u8fd8\u53ef\u4ee5\u5305\u62ec\u7c7b\u578b\uff1breturn \u662f\u8fd4\u56de\u7c7b\u578b\u7684\u63cf\u8ff0\u3002\u4ece\u4e8b C#\/asp.net \u3001Java \u7684\u540c\u5b66\u770b\u7740\u662f\u4e0d\u662f\u89c9\u5f97\u5f88\u719f\u6089\u5440~<\/p>\n<p>\u6b64\u65f6\uff0c\u6211\u4eec\u5728\u9875\u9762\u4e2d\u8f93\u5165 load \u65f6\uff0c\u5c31\u4f1a\u51fa\u73b0\u63cf\u8ff0\u7684\u5185\u5bb9\uff0c\u8f93\u5165\u53c2\u6570\u65f6\uff0c\u5c31\u4f1a\u63d0\u793a\u53c2\u6570\u76f8\u5173\u7684\u4fe1\u606f\uff0c\u611f\u89c9\u592a\u9177\u4e86\u3002<\/p>\n<p>\u5982\u679c\u6211\u4eec\u5728\u6587\u4ef6\u5934\u6dfb\u52a0 reference \u5f15\u7528\uff0c\u5c31\u53ef\u4ee5\u8131\u79bb\u4e0a\u6587\u4e2d js \u4ee3\u7801\u5fc5\u987b\u548c\u667a\u80fd\u63d0\u793a\u6587\u4ef6\u6587\u4ef6\u540d\u5bf9\u5e94\u7684\u9650\u5236\u4e86\uff0c\u4f8b\u5982 \/\/\/ &lt;reference path=&#8221;Scripts\/jquery-1.7.1-intellisense.js&#8221;\/&gt; \u3002\u5982\u679c\u4f60\u613f\u610f\uff0c\u53ef\u4ee5\u540c\u65f6\u5f15\u5165\u591a\u4e2a reference \u6587\u4ef6\uff0c\u9700\u8981\u63d0\u9192\u5404\u4f4d\u7684\u662f\u8fd9\u91cc\u7684\u659c\u6760\u53ef\u662f 3 \u4e2a\u54df\uff0c\u4e0d\u8981\u8f93\u5165\u9519\u4e86\u3002<\/p>\n<p>\u770b\u8d77\u6765\u5f88\u7b80\u5355\uff0c\u5bf9\u4e0d\u5bf9\u3002\u5982\u679c\u6709\u4ec0\u4e48\u95ee\u9898\uff0c\u5feb\u7ed9\u6211\u7559\u8a00\u5427\u3002<\/p>\n","protected":false},"excerpt":{"rendered":"<p>\u5728\u524d\u9762\u7684\u535a\u5ba2\u91cc\u63d0\u53ca Visual Studio 2012 RTM \u5df2\u7ecf\u51fa\u6765\u6709\u4e00\u6bb5\u65f6\u95f4\u4e86\uff0c\u5728 vs \u4ee5\u524d\u7684\u7248\u672c\u91cc [&hellip;]<\/p>\n","protected":false},"author":1,"featured_media":0,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"footnotes":""},"categories":[5],"tags":[98,101,100,97,96,99],"class_list":["post-260","post","type-post","status-publish","format-standard","hentry","category-daily","tag-intellisense","tag-javascript","tag-js","tag-reference","tag-vs2012","tag-99"],"_links":{"self":[{"href":"https:\/\/blog.5danyuan.com\/index.php?rest_route=\/wp\/v2\/posts\/260","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/blog.5danyuan.com\/index.php?rest_route=\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/blog.5danyuan.com\/index.php?rest_route=\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/blog.5danyuan.com\/index.php?rest_route=\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/blog.5danyuan.com\/index.php?rest_route=%2Fwp%2Fv2%2Fcomments&post=260"}],"version-history":[{"count":0,"href":"https:\/\/blog.5danyuan.com\/index.php?rest_route=\/wp\/v2\/posts\/260\/revisions"}],"wp:attachment":[{"href":"https:\/\/blog.5danyuan.com\/index.php?rest_route=%2Fwp%2Fv2%2Fmedia&parent=260"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/blog.5danyuan.com\/index.php?rest_route=%2Fwp%2Fv2%2Fcategories&post=260"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/blog.5danyuan.com\/index.php?rest_route=%2Fwp%2Fv2%2Ftags&post=260"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}