ASP.NET and jQuery
It looks like many of you have already noticed that there's an official Visual Studio autocomplete file for jQuery posted up at the jQuery site. It's significant that it's hosted by the jQuery team in that it's a contribution by the Visual Studio team but it's not up at CodePlex, because it really belongs to jQuery so there's where you'll find it.
This isn't a new jQuery file and nothing's been "forked" so don't freak out. It's just a documentation file, as you can see if you go to the Download jQuery page.
- 1.2.6 (Release Notes)
- Minified, Packed, Uncompressed
- Documentation: Visual Studio
Now, the Visual Studio-specific aspect of this is a temporary thing, as it's planned for Visual Studio to support a more standard syntax at some future date, but until then, there's this file and we'll make sure it's kept updated.
Jeff King has details on how to use this file in your projects. In the VERY near future there will be a hotfix that will cause Visual Studio to look for files that end in "-vsdoc.js" for intellisense which will make including it in your project automatic.
UPDATE: The very near future is NOW. You can now download a small hotfix that causes Visual Studio to automatically look for intellisense files named *-vsdoc.js" next to the runtime file. From Jeff King's blog:
Last week I mentioned we would be releasing a Hotfix to accompany our new jQuery VSDoc file. This Hotfix is now available at the MSDN Code Gallery. Here's a direct download link for this small (2MB) patch:
http://code.msdn.microsoft.com/KB958502/Release/ProjectReleases.aspx?ReleaseId=1736
I want to emphasize that this patch is intended for all JavaScript files, not just those related to jQuery. Generally, we will opportunistically look for documentation files related to the script file. For example, given "mylibrary.js", we will search in the same directory for:
- mylibrary-vsdoc.js, then if we don't find it we will search for...
- mylibrary.debug.js, then if we don't find it we will search for...
- mylibrary.js
There's a few things that are nice about this jQuery file is that it supports and understands jQuery plug-ins. If you're into jQuery and ASP.NET, go check it out.
Related Links
- Stephen Walther's ASP.NET and jQuery presentation at PDC
- jQuery IntelliSense documentation file available
- Rich IntelliSense for jQuery
- jQuery to ship with ASP.NET MVC and Visual Studio
About Scott
Scott Hanselman is a former professor, former Chief Architect in finance, now speaker, consultant, father, diabetic, and Microsoft employee. He is a failed stand-up comic, a cornrower, and a book author.
About Newsletter
I have started using jQuery documentation file in my projects. Its really helpful. I think there should be more things which should be included in VS in future -
1. There should be a folder called "App_Scripts" which will contain scripts file. There should be a switch in Web.Config file, which says whether to "compress" or "minimize" "App_Scripts" folder.
(May be like App_Code folder, you will get automatic intellisense for whatever you have placed in App_Scripts)
2. New templates in VS for creating for jQuery plug-in.
3. Like AJAX Page, there should be jQuery page also ( just give a framework to start) ( I think better to include a whole new group called as jQuery, and in that you have all these file types )
4. You can also provide a URL to look for the documentation and source file. Just press "Update" and get the latest one. (I think jQuery will keep on growing and changing ).
5. And yes people like me, I also dream to "Debug" jQuery, to see how things flow. :)
Shail
Who is the best MS contact to report this issue to?
This is great.. I love using jQuery and this makes it just that much eaiser.
Daniel
Comments are closed.