function not calling on onload but calling on onclick

JavaScript and client side scripting.

Moderator: General Moderators

Post Reply
habib009pk
Forum Commoner
Posts: 43
Joined: Sun Jul 05, 2009 11:28 pm

function not calling on onload but calling on onclick

Post by habib009pk »

Dear friends,

I am facing a problem, I am working on ajax and i want to get the desired result on onload of the body.
and i am using the code:

<script language="javascript" type="text/javascript">
window.onLoad = show_images(<?php echo $lotid; ?>);
</script>

which called the same function easily but the response of ajax is not coming on the desired div. so the error message appears i.e. Done, But with an error.

but when i called the same function on the onclick event the result is 100% correct and i got the response from the ajax

please help me what is i am missing through onload body way that i cannot get the desired result.

Waiting for your reply.

Thanks and Regards
amargharat
Forum Commoner
Posts: 82
Joined: Wed Sep 16, 2009 2:43 am
Location: Mumbai, India
Contact:

Re: function not calling on onload but calling on onclick

Post by amargharat »

Try calling this function in your body tag in following manner

Code: Select all

<body onLoad="show_images(<?php echo $lotid; ?>);">
 
</body>
habib009pk
Forum Commoner
Posts: 43
Joined: Sun Jul 05, 2009 11:28 pm

Re: function not calling on onload but calling on onclick

Post by habib009pk »

Thanks but i tired it before

it was not working at that time and giving the same result at that time

Regards
habib009pk
Forum Commoner
Posts: 43
Joined: Sun Jul 05, 2009 11:28 pm

Re: function not calling on onload but calling on onclick

Post by habib009pk »

please give me any other suggetion if you have

Regards
habib009pk
Forum Commoner
Posts: 43
Joined: Sun Jul 05, 2009 11:28 pm

Re: function not calling on onload but calling on onclick

Post by habib009pk »

Hi Dear

Just for check i also load this page in Firefox and also for the javascript debugger in firebug
but it is working as per requirement in Firefox. There is no problem their.
Now the problem arises in IE That it is not working in IE.

Is it any particular solution for the ajax response in IE on onload calling function

Regards.
Post Reply