| | |
<Body onload= > question
Please support our HTML and CSS advertiser: PostgreSQL or MySQL? Compare and contrast the two most popular open source databases
![]() |
instead of sticking it in the body onload, have you tried calling it in the header of the page:
HTML and CSS Syntax (Toggle Plain Text)
<HTML> <HEAD> <SCRIPT LANGUAGE="Javascript"> function some_function() { } some_function(); </SCRIPT> </HEAD> <!-- The Rest Of The Page -->
•
•
Join Date: Oct 2005
Posts: 6
Reputation:
Solved Threads: 0
•
•
•
•
Originally Posted by maj
Hi there,
I have some java script menus created and I'm calling them from the <body onload> tag as follows:
<body onload="initjsDOMenu()">
Because of this, the menu is the last thing to load on the page. I want it to be the first thing to load. Anyone know what I can do?
Thanks for any help,
Maj
<head>
<javascript>
function();
</javascript>
</head>
•
•
Join Date: Aug 2004
Posts: 49
Reputation:
Solved Threads: 1
•
•
•
•
Originally Posted by vivek vermani
<javascript>
function();
</javascript>
thats what they mean... you can call a javascript function from anywhere on the page, as long as it is in the script tags you describe.
•
•
Join Date: Aug 2004
Posts: 49
Reputation:
Solved Threads: 1
Most times code within onload needs to be there because it references elements of the page that need to be loaded beforehand in order to be able to reference them. Moving the onload code to anywhere else will probably result in "object expected" errors because the part of the page that the script references hasn't loaded yet.
•
•
Join Date: Oct 2005
Posts: 6
Reputation:
Solved Threads: 0
•
•
•
•
Originally Posted by felgall
What language is that written in? It isn't HTML or XHTML because they use <script type="text/javascript"> to call Javascript.
![]() |
Similar Threads
- body.onload += "XX" (JavaScript / DHTML / AJAX)
Other Threads in the HTML and CSS Forum
- Previous Thread: Image for Clear Form
- Next Thread: Bookmark when closing browser.
| Thread Tools | Search this Thread |
appointments asp background backgroundcolor beta browser bug calendar cart cgi code codeinjection corporateidentity css design development displayimageinsteadofflash dreamweaver emailmarketing epilepsy explorer firefox flash form format google griefers hackers hitcounter hover html ide ie7 ie8 iframe image images internet internetexplorer intranet iphone javascript jpeg layout macbook maps marketshare microsoft mozilla multimedia navigationbars news offshoreoutsourcingcompany opacity opera optimization pnginie6 positioning problem scroll seo shopping studio swf swf. textcolor timecolor titletags url urlseparatedwords visual visualization web webdevelopment webform website windows7






