Page 1 of 1

function not calling on onload but calling on onclick

Posted: Thu Sep 17, 2009 11:36 pm
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

Re: function not calling on onload but calling on onclick

Posted: Fri Sep 18, 2009 1:27 am
by amargharat
Try calling this function in your body tag in following manner

Code: Select all

<body onLoad="show_images(<?php echo $lotid; ?>);">
 
</body>

Re: function not calling on onload but calling on onclick

Posted: Fri Sep 18, 2009 1:31 am
by habib009pk
Thanks but i tired it before

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

Regards

Re: function not calling on onload but calling on onclick

Posted: Fri Sep 18, 2009 1:34 am
by habib009pk
please give me any other suggetion if you have

Regards

Re: function not calling on onload but calling on onclick

Posted: Fri Sep 18, 2009 10:27 pm
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.