hi friends,i have facing a problem,when i m calling a function on onLoad event of Body,function is not working.but if i call this function on any other event like onblur etc. it work fine.but my requirement is function called first and last time untill i reload the page.so it is only posssible if i use onload event.but it's not working with it.so pls help me,how can i do this.
Function is not working when calling from Onload event
Collapse
X
-
Tags: None
-
Hi shivendravikram singh,Originally posted by shivendravikram singhhi friends,i have facing a problem,when i m calling a function on onLoad event of Body,function is not working.but if i call this function on any other event like onblur etc. it work fine.but my requirement is function called first and last time untill i reload the page.so it is only posssible if i use onload event.but it's not working with it.so pls help me,how can i do this.
Best way of asking some assistance is posting a thread with the erroneous coding in the relevant forum.
Please Post your codes here enclosed with
[code=language]
[ /code]
tags.
Thanks ! -
This is definitely not the right forum.
Anyway, a common error with onLoad is that a lot of people are still in the stone age and don't use event listeners, so they try to attach more than one event to the document.body.o nLoad attribute, but it doesn't work that way. When using it in that manner, you can't call more than one function. If this is the case, try this:
[code=javascript]document.body.o nload = function(){foo( );bar();};[/code]Comment
Comment