To enable JS intellisense in Visual Studio 2010, you have two options (there are others to do with reference tag name and assembly) but these are the ones that I know work.
i) Add a JavaScript file to an AJAX server control project (which references
System.Web.Extensions
and hence the embedded resource
MicrosoftAJAX.js - you could also probably add an assembly reference to a
web.config for the same effect but I haven't tried it).
ii) Add the following reference tags to the top of the JS file:
iii) Add JS equivalent '
using
' statements to top of JS (below reference) -
Type.registerNamespace("SP.Ribbon");
etc.
The other way is to add:
<asp:ScriptManagerProxy ID="ScriptManagerProxy1" runat="server">
<Scripts>
<asp:ScriptReference Path="~/SP.UI.Dialog.debug.js" />
</Scripts>
</asp:ScriptManagerProxy>
<script type="text/javascript">
...script
</script>
to an aspx page.
Use Ctrl + Shift + J to update javascript intellisense in visual studio.
Adding the debug version is needed because the non debug version is compressed for performance reasons using an older version of Script#.