最新消息:雨落星辰是一个专注网站SEO优化、网站SEO诊断、搜索引擎研究、网络营销推广、网站策划运营及站长类的自媒体原创博客

asp.net - Is there any way to 'hide' a JavaScript file from IntelliSense in Visual Studio 2008? - Stack Overflow

programmeradmin1浏览0评论

I have a third party JavaScript plug-in but including the file breaks IntelliSense for jQuery amongst other things. The only way I can get IntelliSense back working with jQuery is by menting out the plug-in. Is there a way I can hide the plug-in file from the IntelliSense parser?

I have a third party JavaScript plug-in but including the file breaks IntelliSense for jQuery amongst other things. The only way I can get IntelliSense back working with jQuery is by menting out the plug-in. Is there a way I can hide the plug-in file from the IntelliSense parser?

Share Improve this question edited Dec 14, 2009 at 20:28 Peter Mortensen 31.6k22 gold badges110 silver badges133 bronze badges asked Nov 12, 2008 at 21:50 fleshflesh 23.9k24 gold badges82 silver badges98 bronze badges
Add a ment  | 

4 Answers 4

Reset to default 9

Service Pack 1 added the following feature:

If you "anyfile.js" and "anyfile-vsdoc.js" in the same directory, then any references to "anyfile.js" will automagically be converted to a reference to "anyfile-vsdoc.js" behind the scenes.

Add an empty file next to your plugin with "-vsdoc" appended to the filename. That should "hide" the plug-in from the external javascript processor.

You could always load it from your code-behind instead of the scriptmanager in your aspx/master. That way the IntelliSense doesn't know it's there. Using ScriptManager.RegisterClientScriptInclude(..).

It could be that third party JavaScript plugin you're using has some errors in it.
I would check the code in JSLint and directed this question to the author of the plugin.
As for the question itself: I don't think you can exclude it if it's a part of the project, but go over the MSDN: Using IntelliSense to prove it.

Since you mentioned jQuery, you could also load the troublesome script during runtime.

$.getScript("XXX.js");

发布评论

评论列表(0)

  1. 暂无评论