HTML5 Javascript API Intellisense support in visual studio

a 夏天 提交于 2020-01-01 04:34:04

问题


I started playing with HTML5/CSS3 and the new JavaScript API

something i noticed in VS 2010 is it doesn't have any support for the new JavaScript API i was wondering if there is anything i can do about it

so in Vs2010 if i type :

     var canvas = document.getElementById('diagonal');
     var context = canvas.getContext('2d');

i don't get any intellisense for the "getContext" method etc..

i dont wanna write the code and compile and pray it works.

any idea how can i enable intellisense for new javascript ?


回答1:


I know you tagged VS2010, but the Visual Studio 11 Developer Preview, and presumably the eventual RTM, natively supports HTML5 intellisense, including support for canvas.

IntelliSense for DOM APIs has been improved, with support for many new HTML5 APIs including querySelector, DOM Storage, cross-document messaging, and canvas. DOM IntelliSense is now driven by a single simple JavaScript file, rather than by a native type library definition. This makes it easy to extend or replace.




回答2:


vsdoc documentation for Canvas for Visual Studio 2010:

http://abstractform.wordpress.com/2010/02/18/canvas-intellisense-auto-completion-in-visual-studio/




回答3:


This artricle describes how to add intellisense. The system looks pretty flexible. I think you'll need to download a special doc version of the JS API though.

http://msdn.microsoft.com/en-us/library/ff798328.aspx

Here is another

http://blog.turlov.com/2010/05/leveraging-visual-studio-javascript.html



来源:https://stackoverflow.com/questions/7514560/html5-javascript-api-intellisense-support-in-visual-studio

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!