I am passing in a jQuery object into a function from another file via an array like the following:
$(document).bind("loadStoreDisplayCallGoals", function(source, urlParams)
{
var selectedStoreDocument = urlParams["storeDocument"];
}
selectedStoreDocument should be a jQuery object, however Visual Studio Intellisense will never recognize it as such. I tried adding extending selectedStoreDocument with $.extend:
// cast selectedStoreDocument to a jQuery type
$.extend(selectedStoreDocument, $);
However, extending selectedStoreDocument wiped out all of my jQuery methods (.each, .find, etc.).
How can I get selectedStoreDocument to appear as a jQuery object in IntelliSense? Note that I am working in Visual Studio 2010.
I created a separate file for utility functions, and a second file for the utility functions + VSDoc.
utilities.js:
utilities-vsdoc.js:
Now I can call castToJQuery in any of my downstream files to make Visual Studio think a dynamic property is a jQuery object.
Visual Studio now works with Intellisense for my dynamic urlParams[“storeDocument”].