Visual Studio jscript intellisense错误与jQuery 1.2.6?

时间:2022-01-02 01:52:45

I get the warning "childNodes is null or not an object' with different line numbers, depending on which version of the library I reference (I've tried about three different versions of 1.2.6). Consequently, I get jack for jQuery intellisense.

我得到警告“childNodes为null或不是具有不同行号的对象”,具体取决于我引用的库的版本(我尝试过三个不同版本的1.2.6)。因此,我得到jQuery intellisense的插孔。

I can hack this to get it to work, but I'd rather not as I don't understand the full implications of changing the following line:

我可以破解它以使其工作,但我不愿意,因为我不理解更改以下行的全部含义:

elem = jQuery.makeArray(div.childNodes);

to this:

//HACK:  VS intellisense fix
if(div && div.childNodes)
  elem = jQuery.makeArray(div.childNodes);

(The changed line only appears once in the source). What gives?

(更改的行仅在源中出现一次)。是什么赋予了?

3 个解决方案

#1


1  

Have you tried adding a reference to the documentation-only file available here? jQuery IntelliSense in Visual Studio 2008

您是否尝试添加对此处提供的仅文档文件的引用? Visual Studio 2008中的jQuery IntelliSense

#2


5  

I ran into this same issue a little while back. Are you using the jQuery UI files as well? I was and it turned out that the jquery ui javascript file was messing up the intellisense somehow. So I created an empty vsdoc.js file for the jquery ui file and then intellisense started working. My jquery ui file was called jquery-ui-personalized-1.6rc2.min.js. Creating a file called jquery-ui-personalized-1.6rc2.min-vsdoc.js fixed the issue.

我不久前遇到了同样的问题。你也在使用jQuery UI文件吗?我当时发现jquery ui javascript文件以某种方式弄乱了intellisense。所以我为jquery ui文件创建了一个空的vsdoc.js文件,然后intellisense开始工作。我的jquery ui文件名为jquery-ui-personalized-1.6rc2.min.js。创建一个名为jquery-ui-personalized-1.6rc2.min-vsdoc.js的文件解决了这个问题。

I was also using jquery-jtemplates.js but that did not seem to cause a problem. I think it is just the jquery-ui file.

我也使用jquery-jtemplates.js,但似乎没有引起问题。我认为这只是jquery-ui文件。

#3


0  

It does work for me; Not sure why it is an error for me and why the fix is needed?

它对我有用;不知道为什么这对我来说是一个错误,为什么需要修复?

#1


1  

Have you tried adding a reference to the documentation-only file available here? jQuery IntelliSense in Visual Studio 2008

您是否尝试添加对此处提供的仅文档文件的引用? Visual Studio 2008中的jQuery IntelliSense

#2


5  

I ran into this same issue a little while back. Are you using the jQuery UI files as well? I was and it turned out that the jquery ui javascript file was messing up the intellisense somehow. So I created an empty vsdoc.js file for the jquery ui file and then intellisense started working. My jquery ui file was called jquery-ui-personalized-1.6rc2.min.js. Creating a file called jquery-ui-personalized-1.6rc2.min-vsdoc.js fixed the issue.

我不久前遇到了同样的问题。你也在使用jQuery UI文件吗?我当时发现jquery ui javascript文件以某种方式弄乱了intellisense。所以我为jquery ui文件创建了一个空的vsdoc.js文件,然后intellisense开始工作。我的jquery ui文件名为jquery-ui-personalized-1.6rc2.min.js。创建一个名为jquery-ui-personalized-1.6rc2.min-vsdoc.js的文件解决了这个问题。

I was also using jquery-jtemplates.js but that did not seem to cause a problem. I think it is just the jquery-ui file.

我也使用jquery-jtemplates.js,但似乎没有引起问题。我认为这只是jquery-ui文件。

#3


0  

It does work for me; Not sure why it is an error for me and why the fix is needed?

它对我有用;不知道为什么这对我来说是一个错误,为什么需要修复?