在visual studio中支持HTML5 Javascript API的智能感知

时间:2021-10-26 09:17:05

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

我开始使用HTML5/CSS3和新的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

在VS 2010中,我注意到它不支持新的JavaScript API,我想知道是否有什么可以做的

so in Vs2010 if i type :

在Vs2010中,如果我输入:

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

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

我对“getContext”方法等没有任何理解。

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

我不想写代码,编译并祈祷它能工作。

any idea how can i enable intellisense for new javascript ?

你知道如何为新的javascript启用智能感知吗?

3 个解决方案

#1


2  

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.

我知道您标记了VS2010,但是Visual Studio 11 Developer Preview,以及最终的RTM,在本地支持HTML5 intellisense,包括对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.

DOM api的智能感知得到了改进,支持许多新的HTML5 api,包括querySelector、DOM存储、跨文档消息传递和canvas。DOM IntelliSense现在是由一个简单的JavaScript文件驱动的,而不是由一个本地类型库定义驱动的。这使得扩展或替换变得很容易。

#2


3  

vsdoc documentation for Canvas for Visual Studio 2010:

Visual Studio 2010的Canvas的vsdoc文档:

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

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

#3


1  

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.

本文介绍了如何添加智能感知。这个系统看起来很灵活。我认为您需要下载JS API的一个特殊的doc版本。

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

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

Here is another

这是另一个

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

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

#1


2  

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.

我知道您标记了VS2010,但是Visual Studio 11 Developer Preview,以及最终的RTM,在本地支持HTML5 intellisense,包括对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.

DOM api的智能感知得到了改进,支持许多新的HTML5 api,包括querySelector、DOM存储、跨文档消息传递和canvas。DOM IntelliSense现在是由一个简单的JavaScript文件驱动的,而不是由一个本地类型库定义驱动的。这使得扩展或替换变得很容易。

#2


3  

vsdoc documentation for Canvas for Visual Studio 2010:

Visual Studio 2010的Canvas的vsdoc文档:

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

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

#3


1  

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.

本文介绍了如何添加智能感知。这个系统看起来很灵活。我认为您需要下载JS API的一个特殊的doc版本。

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

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

Here is another

这是另一个

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

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