I am using the jquery tabs which makes the ajax call on tab click.On click of tab, tabs make the ajax callto bring the html response and then append in current page. The issue i am facing is;-
in the ajax response i have below javascript code where customer.js contains the function i.e checkCustId()
<SCRIPT language="JavaScript" src="script/customer.js"></SCRIPT>
<SCRIPT language="JavaScript">checkCustId();</SCRIPT>
Now on click of tab, i get the error that " function checkCustId() is not defined" ,though customer.js contains the function i.e checkCustId(). As per my understanding this is happening, becuse ajax response does not bring the customer.js file and thats why jquery is not able to find the function checkCustId while evaluating the javascript internally.Is there a way where javascript file is also fetched on tab click/also during making explicit ajax call?
I got to solve it by including the definition of method checkCustId in javascript response only.This happening jquery does not bring the actual js file as part of ajax response at the time it evaluates the javascript