But when I started to add some javascript codes to my project sometimes I forgot some functions or properties of javascript, specially those in jQuery and the once that I have created so I keep on changing page just to see what are those functions and/or properties. So I search the web and found out this very helpfull blog of ScuttGu's on jQuery Intellisen in VS 2008
After I have completed the steps on how to Enable jQuery Intellisense in VS 2008. It works terrific! But only in the same page as where I put my <script> block that calls out the jQuery js file. Because whe I start coding a separate .js file, the jQuery intellisence is gone so I wonder why the jQuery intellisense will not show in the separate .js file. And I found out a post of Reference JS file in Other JS File and Intellisence. It works like a charm.
So when I want to access an intellisense of jQuery in my Person.js file, I'll just add
/// <reference path="path-to-my-jquery.js" />
at the first line of my Person.js file. If you want to add more intellisense in your .js file just add the reference path to your other .js file.
And in addition to that. I've tried to add some summary to my functions and properties that I've created so I can review them without going back to the .js file where I wrote the functions.
Person.ComputeAge = function(yearToday, birthYear) {
/// <summary>
/// Compute the age of the person
/// </summary>
/// <param type="Int">Current Year</param>
/// <param type="Int">Birth Year</param>
...
// my code goes here
...
}
/// <summary>
/// Compute the age of the person
/// </summary>
/// <param type="Int">Current Year</param>
/// <param type="Int">Birth Year</param>
...
// my code goes here
...
}
so when I tried to access Person.ComputeAge() it will display a summary of the function just like the intellisense of Visual Studio.
No comments:
Post a Comment