I have a Jquery function defined as :
jQuery(document).ready(function($){
function initAutoComplete(textBox, query, isMustMatch, isAjaxAfterKeyPress)
{
// autocomplete logic
}
});
I am calling this function from outside document.ready as :
initAutoComplete($("#txt" + FromTo + "Country"), "WebAddr?srvList=Country&areaCd=OT&val=", true, false);
the initAutoComplete is not recognized which is correct as its inside the scope of document.ready().
I tried below code by hooking the function with window
object :
window.initAutoComplete = function(textBox, query, isMustMatch, isAjaxAfterKeyPress)
{
//autocomplete logic
}
Now I called this function from outside document.ready as :
initAutoComplete($("#txt" + FromTo + "Country"), "WebAddr?srvList=Country&areaCd=OT&val=", true, false);
But I am unable to fix the reference error : initAutoComplete is not recognized. Any help is appreciated. Thanks!