I have multiple javascript files and they have their own functions. If I make reference one of them to inside any of them, it doesnt see its functions if the function is not prototype. What is logic inside the Intellisense ?
I want to use Splash function with Intellisense feature below, how can I do that ?
//My.js
/// <reference path="Test.js" />
.
//Test.js
NameSpace.prototype.UI = new function () {
this.Splash = function (value) {
try {
if (value == 1) {
$('#splash').css('height', $(document).height());
$('#splashContent').css('top', $(window).height() / 2);
$('#splash').fadeIn();
$('#splashContent').fadeIn();
setTimeout("SF.UI.Splash(0)", 3000);
}
else if (value == 0) {
$('#splash').fadeOut(1000);
$('#splashContent').fadeOut(1000);
}
else if (value == 3) {
$('#splash').css('height', $(document).height());
$('#splashContent').css('top', $(window).height() / 2);
$('#splash').fadeIn();
$('#splashContent').fadeIn();
}
} catch (e) {
Splash(0);
}
}
}
JS Intellisense is flaky at best. Despite all those articles, in my experience, it doesn’t work as advertised. I would suggest:
/// <reference path="Test.js" />is the very first line in JS.Test.jsfile (run JSLint on it to be sure) or use the vsdoc approach.Outputtool window to see if it contains any errors related to updating intellisense. This will help you troubleshoot and remove errors in your referenced JS file.Alternative to create a
Test-vsdoc.jsfile (this way, even if your main JS file has errors, it would not cause intellisense to fail) :VS would automatically include it next time you restart the IDE (or try a force update Ctrl+Shift+J)