Visual Studio jscript intellisense error with jQuery 1.2.6?

99封情书 提交于 2019-12-10 10:37:50

问题


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.

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?


回答1:


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




回答2:


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.

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.




回答3:


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



来源:https://stackoverflow.com/questions/218578/visual-studio-jscript-intellisense-error-with-jquery-1-2-6

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