如何在Visual Studio 2008中获取JavaScript / jQuery的智能感知工作? [英] How do you get JavaScript/jQuery Intellisense Working in Visual Studio 2008?

查看:115
本文介绍了如何在Visual Studio 2008中获取JavaScript / jQuery的智能感知工作?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我觉得jQuery的智能感知应该与SP1改进。我甚至下载的jQuery 1.2.6的注释版本,但智能感知不会在一个单独的文件的JScript工作。我第一次引用的&lt我的网页上的jQuery库; head>标记。难道我做错了什么?

I thought jQuery Intellisense was supposed to be improved with SP1. I even downloaded an annotated version of jQuery 1.2.6, but intellisense will not work in a separate jscript file. I have the jQuery library referenced first on my web page in the <head> tag. Am I doing anything wrong?

推荐答案

在外部的顶部JavaScript文件,添加以下内容:

At the top of your external JavaScript file, add the following:

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

确认路径是正确的,相对于文件夹结构文件的位置,等等。

Make sure the path is correct, relative to the file's position in the folder structure, etc.

此外,任何引用必须在文件的顶部,之前的任何的其他文本,包括注释 - 从字面上看,该文件中的第一件事情。希望未来的Visual Studio版本无论它是在文件中工作,或者他们会做一些完全不同的......

Also, any references need to be at the top of the file, before any other text, including comments - literally, the very first thing in the file. Hopefully future version of Visual Studio will work regardless of where it is in the file, or maybe they will do something altogether different...

一旦你已经做到了和的保存文件的,按<大骨节病>控制 + <大骨节病>切换 + <大骨节病>Ĵ来强制Visual工作室更新智能感知。

Once you have done that and saved the file, hit Ctrl + Shift + J to force Visual Studio to update Intellisense.

这篇关于如何在Visual Studio 2008中获取JavaScript / jQuery的智能感知工作?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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