473,410 Members | 1,950 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,410 software developers and data experts.

Function is not working when calling from Onload event

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.
Jun 30 '07 #1
4 2259
ak1dnar
1,584 Expert 1GB
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.
Hi shivendravikramsingh,

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 !
Jun 30 '07 #2
ak1dnar
1,584 Expert 1GB
Thread title changed - Ajaxrand
From function is not working? to >>> Function is not working when calling from Onload event
Jun 30 '07 #3
kovik
1,044 Expert 1GB
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.onLoad 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:

Expand|Select|Wrap|Line Numbers
  1. document.body.onload = function(){foo();bar();};
Jun 30 '07 #4
zee88
1
Thanks kovik, your function worked for me very well ... i was facing that problem since last 2 days... Thanks again for your post...

Zeeshan...(From Pakistan)
Working Function:

document.body.onload = function(){foo();bar();};
Feb 29 '12 #5

Sign in to post your reply or Sign up for a free account.

Similar topics

7
by: MALdito | last post by:
hi everybody let me say right from the start .. I´m not a coder ... "just" a designer! that said .. here is my question: I´m using dreamweaver´s built in preloader for a menu. it looks like...
11
by: JS | last post by:
I have made a function createFirstMenu where I call "resetMenu" in a JavaScript. But nothing happens when I call resetMenu. function createFirstMenu(sel){ sel = document.getElementById('sel1');...
5
by: elsenraat_76 | last post by:
Hello! I was wondering if someone could help me out with a problem I'm having? I'm trying to input a javascript value into an anchor tag (from a function), but don't have an event to call the...
39
by: Randell D. | last post by:
Folks, I'm sure this can be done legally, and not thru tricks of the trade - I hope someone can help. I'm writing a 'tool' (a function) which can be used generically in any of my projects. ...
2
by: laredotornado | last post by:
Hello, I am looking for a cross-browser way (Firefox 1+, IE 5.5+) to have my Javascript function execute from the BODY's "onload" method, but if there is already an onload method defined, I would...
6
by: adolf garlic | last post by:
A postback I'm doing takes ages to get the data which it then uses to populate a table. What I want to know is: How can I get the client side to fire a 'resize' event when the postback thing...
7
by: Q | last post by:
Question: why doesn't: window.onLoad = recalculate(); work, and do I have to use: window.onLoad = recalculate; (IE) ???
4
by: Michael | last post by:
Hi, I'm having difficulty finding any previous discussion on this -- I keep finding people either having problems calling os.exec(lepev), or with using python's exec statement. Neither of...
53
by: souporpower | last post by:
Hello All I am trying to activate a link using Jquery. Here is my code; <html> <head> <script type="text/javascript" src="../../resources/js/ jquery-1.2.6.js"</script> <script...
0
by: emmanuelkatto | last post by:
Hi All, I am Emmanuel katto from Uganda. I want to ask what challenges you've faced while migrating a website to cloud. Please let me know. Thanks! Emmanuel
1
by: nemocccc | last post by:
hello, everyone, I want to develop a software for my android phone for daily needs, any suggestions?
0
by: Hystou | last post by:
There are some requirements for setting up RAID: 1. The motherboard and BIOS support RAID configuration. 2. The motherboard has 2 or more available SATA protocol SSD/HDD slots (including MSATA, M.2...
0
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However,...
0
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers,...
0
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven...
0
by: Hystou | last post by:
Overview: Windows 11 and 10 have less user interface control over operating system update behaviour than previous versions of Windows. In Windows 11 and 10, there is no way to turn off the Windows...
0
agi2029
by: agi2029 | last post by:
Let's talk about the concept of autonomous AI software engineers and no-code agents. These AIs are designed to manage the entire lifecycle of a software development project—planning, coding, testing,...
0
by: conductexam | last post by:
I have .net C# application in which I am extracting data from word file and save it in database particularly. To store word all data as it is I am converting the whole word file firstly in HTML and...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.