Login | Register   
LinkedIn
Google+
Twitter
RSS Feed
Download our iPhone app
TODAY'S HEADLINES  |   ARTICLE ARCHIVE  |   FORUMS  |   TIP BANK
Browse DevX
Sign up for e-mail newsletters from DevX


Tip of the Day
Language: Client Scripting
Expertise: Beginner
Jan 13, 2000

Using More Than One OnLoad Command

Question:
Is it possible to use more than one onLoad command in my tag?

Answer:
Sure. Like other event handlers, the onLoad event handler you're including within the tag on your page can actually be any valid piece of JavaScript code. This means that you're not limited to executing just one command. If you'd like, you can include multiple commands, separating each one with a semicolon (;), as per the standard JavaScript syntax. However, unless you're including only one or two simple commands, you'd be better off calling a function. This gives you the flexibility of adding more complex event handling code later on without making your HTML hard-to-read.

DevX Pro
 
Comment and Contribute

 

 

 

 

 


(Maximum characters: 1200). You have 1200 characters left.

 

 

Sitemap
Thanks for your registration, follow us on our social networks to keep up-to-date