参考JavaScript文件使用Visual Studio 2010 intellisense [英] Reference javascript files to use visual studio 2010 intellisense

查看:202
本文介绍了参考JavaScript文件使用Visual Studio 2010 intellisense的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我有一个非常重的网站(长JavaScript> 100KB + JQuery)。所以,为了让JavaScript可以重用,我想在不同的JavaScript文件中分离逻辑。

所以,我想制作一个汇总的JavaScript文件





请告诉我(我甚至想在我的主JS文件中使用关于其他JS文件功能的VS2010 intellisense。)

解决方案

Javascript Intellisense往往是非常不可靠的,因为一些更新打破了它的一些更新修复了它,并且围绕它有很多扩展,打破对方。



对于像这样的情况,仍有一个 ///< reference> 元素。



请参阅 MSDN文章并添加行:

  ///< reference path =otherscript.js/> 

位于脚本文件的顶部。



<尝试使用jQuery vsdoc和其他脚本文件进行测试。



同时安装MVC4安装了一些依赖项或任何对我来说或多或少固定的javascript intellisense 。


I have a website with very heavy (long javascript > 100KB + JQuery). So, for making the javascript re-useable, I want to separate the logic in different javascript files.

So, I want to make an aggregated javascript file

Please tell me how (I even want to use the VS2010 intellisense in my main JS file about the functions of the other JS files.)

解决方案

Javascript Intellisense tends to be extremely unreliable as some updates broke it some updates fixed it, and there are a lot of extensions around it, breaking each other.

Still there is a /// <reference> element for cases like this.

See MSDN article and add line:

/// <reference path="otherscript.js" />

at the top of your script file.

Try to test it with the jQuery vsdoc and your other script files.

Also installing MVC4 installed some dependency or whatever that more-or-less fixed javascript intellisense for me.

这篇关于参考JavaScript文件使用Visual Studio 2010 intellisense的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆