This week's book giveaway is in the Servlets forum.
We're giving away four copies of Murach's Java Servlets and JSP and have Joel Murach on-line!
See this thread for details.
The moose likes HTML, CSS and JavaScript and the fly likes Onload complex issue Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login


Win a copy of Murach's Java Servlets and JSP this week in the Servlets forum!
JavaRanch » Java Forums » Engineering » HTML, CSS and JavaScript
Bookmark "Onload complex issue" Watch "Onload complex issue" New topic
Author

Onload complex issue

Raj Puri
Ranch Hand

Joined: Apr 24, 2003
Posts: 189
I tried to use onload, but I already have an onload that creates some text items dynamically and all my hyperlink does apart from other things disables some of these items that I create to start with.
It is like I want to create some text dynamically and disable some of them
on load as well. Any idea? I gues HTML has only onload event to handle this kind of thing.
William Brogden
Author and all-around good cowpoke
Rancher

Joined: Mar 22, 2000
Posts: 12756
    
    5
Exactly what is the sequence of events that you want to occur?
Raj Puri
Ranch Hand

Joined: Apr 24, 2003
Posts: 189
I have code like this:
window.on_load=f_1(); //f_1 dynamically creates some text items.
in body tag on_load=f_2()
f_2() functions disables some of the items created by f_1 above depending on business logic.

Seems f_2 does not fire. However if I comment out f_1 on load f_2 in body tag does work, So it is not a syntax problem. I am thinking it is more timing issue. If I call f_2 within f_1 i.e. have only one onload function
I get error object not found.

How else can I do this?
Eric Pascarello
author
Rancher

Joined: Nov 08, 2001
Posts: 15376
    
    6
combine them both in the body tag

onload="function1();function2()"

OR

use a function with the function calls

Eric
Yuriy Fuksenko
Ranch Hand

Joined: Feb 02, 2001
Posts: 413
 
I agree. Here's the link: http://aspose.com/file-tools
 
subject: Onload complex issue
 
Similar Threads
Passing Data From A Servlet to Javascript excuting at onload
How Create Text boxs Dynamically
dynamically creating a text box
JavaScript: Dynamic Radio button
JQuery:- Adding event to element not present currrently