Page 1 of 1
calling two functions from event
Posted: Sun Jun 14, 2009 2:46 pm
by tanvirtonu
I have two javascript functions on html body load event.Two functions create a table populating data from the same table.One table show single field and another several fields.Two tables are placed in two different places (using different div id).But as the page loads only one table is shown(second one).If I call each function one at a time from onload event both works fine but as I place two functions together only one is executed.What is the problem?PLs help.
The following is my body load event html
Code: Select all
<body onload="getCusName();getCusInfo()">
Re: calling two functions from event
Posted: Mon Jun 15, 2009 12:05 pm
by kaszu
I assume there could be an error which prevents second function from being called (you said second function is executed, so this couldn't be the case, but maybe when you checked you had these functions written in reverse order?).
Please post getCutName and getCusInfo code.
Re: calling two functions from event
Posted: Tue Jun 16, 2009 9:51 am
by tanvirtonu
kaszu wrote:I assume there could be an error which prevents second function from being called (you said second function is executed, so this couldn't be the case, but maybe when you checked you had these functions written in reverse order?).
Please post getCutName and getCusInfo code.
I got the answer.As I was using php- ajax,you cant run many XMLHttpRequest simultaneously with html onload event and that is what I did.Solution is to get different XMLHttpRequest for different call to a function.Thank u though.