I have a php web based application with dhtml menu.
Each time user click menu Item, the page loads external php page into a div container in that page and then load external javascript as the clientside event handler of that loaded page.I load both of them using ajax method.
The problem is: how to call a function of that external javascript soon after the external javascript file loaded into main page?
I tried eval(functionNa me()) but it returns error Object Required.I got confused because the functionName is declared in that external javascript.I tried to catch the readyState of XmlHttpRequest and the result shows that by the time i call functionName() XmlHttpRequest readyState is still 1.So then i puut a loop 'while do' that say when the readyState reach 4,call functionName() n then i got this Browser Message that say something like script make browser run slowly and nothing happened not even close to my expectation...
Please help me.. feel desperate now..
Each time user click menu Item, the page loads external php page into a div container in that page and then load external javascript as the clientside event handler of that loaded page.I load both of them using ajax method.
The problem is: how to call a function of that external javascript soon after the external javascript file loaded into main page?
I tried eval(functionNa me()) but it returns error Object Required.I got confused because the functionName is declared in that external javascript.I tried to catch the readyState of XmlHttpRequest and the result shows that by the time i call functionName() XmlHttpRequest readyState is still 1.So then i puut a loop 'while do' that say when the readyState reach 4,call functionName() n then i got this Browser Message that say something like script make browser run slowly and nothing happened not even close to my expectation...
Please help me.. feel desperate now..
Comment