calling two functions from event

JavaScript and client side scripting.

Moderator: General Moderators

Post Reply
tanvirtonu
Forum Commoner
Posts: 35
Joined: Wed Oct 17, 2007 9:15 am

calling two functions from event

Post 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()">
User avatar
kaszu
Forum Regular
Posts: 749
Joined: Wed Jul 19, 2006 7:29 am

Re: calling two functions from event

Post 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.
tanvirtonu
Forum Commoner
Posts: 35
Joined: Wed Oct 17, 2007 9:15 am

Re: calling two functions from event

Post 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.
Post Reply