简体   繁体   English

jQuery以及对js和vsdoc.js文件的引用

[英]jQuery and reference to js and vsdoc.js files

Within vs.net I need to set references to both js and vsdoc.js files for jQuery. 在vs.net中,我需要设置对jQuery的js和vsdoc.js文件的引用。 Things work great if the script files are within the project HOWEVER I really want to reference a standard folder on our server ie http://www.domain.com/script/jQuery for the location of these files. 如果脚本文件在项目中,则一切正常,但是我真的想引用服务器上的标准文件夹,即http://www.domain.com/script/jQuery ,以获取这些文件的位置。 On our local workstation we have these files located in http://localhost/script/jQuery 在本地工作站上,这些文件位于http:// localhost / script / jQuery

How can I reference both consistent location as well as get the benefits of intellsense and F5 (development server) references working well? 我如何既可以引用一致的位置,又可以很好地利用智能和F5(开发服务器)引用?

thx 谢谢

If I undrestand your question well, then you could use relative address for your jQuery JS files. 如果我不太理解您的问题,那么您可以为jQuery JS文件使用相对地址。

So for linking to JS files just use "/script/jQuery/XXXX.JS" in your script tag instead of using http://localhost/script/jQuery/XXXX.JS or http://www.domain.com/script/jQuery/XXXX.JS ! 因此,要链接到JS文件,只需在脚本标签中使用“ /script/jQuery/XXXX.JS”,而不要使用http://localhost/script/jQuery/XXXX.JShttp://www.domain.com/script /jQuery/XXXX.JS

Also if you want to have production-ready js file for jQuery (.min.js) you can link that but in your JS files add reference to VSDOC (Drag it and drop VSDOC file on top of your js code to add reference for it) 另外,如果您想为jQuery(.min.js)提供可用于生产的js文件,则可以链接该文件,但是在JS文件中添加对VSDOC的引用(将其拖放到js代码顶部即可添加VSDOC文件的引用) )

I hope this helps but if you mean something else, would you please explain more so we can help better :) 希望对您有所帮助,但如果您有其他意思,请您进一步说明,以便我们提供更好的帮助:)

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM