Velocity Reviews - Computer Hardware Reviews

Velocity Reviews > Newsgroups > Programming > Javascript > Append function to onLoad

Reply
Thread Tools

Append function to onLoad

 
 
Steve Macleod
Guest
Posts: n/a
 
      10-01-2006
Hi,
I am writing a function which will be included on other pages. I need
to append a function call to the body onload event without disrupting
other function calls which may/may not be there. Does anyone know how
to achieve this?

 
Reply With Quote
 
 
 
 
madureira.hugo@gmail.com
Guest
Posts: n/a
 
      10-01-2006
Hello Steve!

Check this url: http://www.dustindiaz.com/top-ten-javascript

You will find what you are looking for.


Hugo Madureira


Steve Macleod wrote:
> Hi,
> I am writing a function which will be included on other pages. I need
> to append a function call to the body onload event without disrupting
> other function calls which may/may not be there. Does anyone know how
> to achieve this?


 
Reply With Quote
 
 
 
 
Evertjan.
Guest
Posts: n/a
 
      10-01-2006
Steve Macleod wrote on 01 Oct 2006 in comp.lang.javascript:

> I am writing a function which will be included on other pages.


Other?

Oh you mean in an include file.

> I need
> to append a function call to the body onload event without disrupting
> other function calls which may/may not be there. Does anyone know how
> to achieve this?
>


will this help?

======= test.html ===============
<body onload="alert('a');">

<script type='text/javascript'>

function b(){
alert('b');
};

var x = window.onload
window.onload = function(){b();x();}

</script>
==================================


--
Evertjan.
The Netherlands.
(Please change the x'es to dots in my emailaddress)
 
Reply With Quote
 
Steve Macleod
Guest
Posts: n/a
 
      10-01-2006
Yeah that is it!
simple really, I guess. Must have been at this too long!

Thanks for the help!

 
Reply With Quote
 
Evertjan.
Guest
Posts: n/a
 
      10-01-2006
Steve Macleod wrote on 01 Oct 2006 in comp.lang.javascript:

> Yeah that is it!
> simple really, I guess. Must have been at this too long!
>


Sorry, What are you talking about?

On usenet please always quote, usenet is not email.

--
Evertjan.
The Netherlands.
(Please change the x'es to dots in my emailaddress)
 
Reply With Quote
 
 
 
Reply

Thread Tools

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are Off


Similar Threads
Thread Thread Starter Forum Replies Last Post
the address of list.append and list.append.__doc__ HYRY Python 10 09-26-2007 09:41 AM
onload -->* no onload marco Javascript 7 06-24-2006 08:39 PM
Why doesn't frameset onload event get called when each of the frames has an onload? adnanx82@gmail.com Javascript 5 05-15-2005 01:58 PM
base.OnLoad called, OnLoad not executed Fabio R. ASP .Net 0 03-25-2005 01:21 PM
window.onload and body.onload differences David Otton Javascript 2 11-04-2004 04:34 PM



Advertisments