Current location: Hot Scripts Forums » General Web Coding » JavaScript » Running Onload


Running Onload

Reply
  #1 (permalink)  
Old 08-27-03, 09:55 AM
hari.kara hari.kara is offline
Newbie Coder
 
Join Date: Aug 2003
Location: London, UK
Posts: 5
Thanks: 0
Thanked 0 Times in 0 Posts
Running Onload

Can anyone tell me if there is any way of running two or more onload commands at the same time on a single page. And if there is can you show me or direct me in the right direction.

__________________
Be the best you can!
Hari
Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiShare on FacebookShare on Stumble UponShare on Twitter
Reply With Quote
  #2 (permalink)  
Old 08-28-03, 12:12 PM
Shane Shane is offline
Coding Addict
 
Join Date: Jun 2003
Location: Maryland, US
Posts: 268
Thanks: 0
Thanked 0 Times in 0 Posts
Re: Running Onload

Quote:
Originally posted by hari.kara
Can anyone tell me if there is any way of running two or more onload commands at the same time on a single page. And if there is can you show me or direct me in the right direction.

Code:
<html>
<head>
<title>Test</title>
<script language="javascript">
function cmdLoad() {

firstStep();

secondStep();


}

function firstStep() {


}

function secondStep() {


}
</script>
</head>
<body onload="cmdLoad()">

</body>
</html>
__________________
Shane Bauer
Microsoft Certified Professional (MCP) - ASP.NET
ASP/ASP.net, C#, VB/VB.NET, PHP, Perl, SQL
Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiShare on FacebookShare on Stumble UponShare on Twitter
Reply With Quote
  #3 (permalink)  
Old 08-29-03, 10:54 AM
hari.kara hari.kara is offline
Newbie Coder
 
Join Date: Aug 2003
Location: London, UK
Posts: 5
Thanks: 0
Thanked 0 Times in 0 Posts
Thanks Shane,

Im assuming if i keep adding the classes ie third, fourth, i can run a fair few onloads at the same time?
__________________
Be the best you can!
Hari
Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiShare on FacebookShare on Stumble UponShare on Twitter
Reply With Quote
  #4 (permalink)  
Old 08-29-03, 11:06 AM
Shane Shane is offline
Coding Addict
 
Join Date: Jun 2003
Location: Maryland, US
Posts: 268
Thanks: 0
Thanked 0 Times in 0 Posts
Yup, that's correct.

I always did it that way because it's a lot easier to look at, unlike the inline version. (i.e onload="firstStep(); secondStep();")
__________________
Shane Bauer
Microsoft Certified Professional (MCP) - ASP.NET
ASP/ASP.net, C#, VB/VB.NET, PHP, Perl, SQL
Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiShare on FacebookShare on Stumble UponShare on Twitter
Reply With Quote
  #5 (permalink)  
Old 08-29-03, 11:13 AM
hari.kara hari.kara is offline
Newbie Coder
 
Join Date: Aug 2003
Location: London, UK
Posts: 5
Thanks: 0
Thanked 0 Times in 0 Posts
Is there a limit to how many.. or are the constraints just the loading time...
__________________
Be the best you can!
Hari
Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiShare on FacebookShare on Stumble UponShare on Twitter
Reply With Quote
  #6 (permalink)  
Old 08-29-03, 12:16 PM
Shane Shane is offline
Coding Addict
 
Join Date: Jun 2003
Location: Maryland, US
Posts: 268
Thanks: 0
Thanked 0 Times in 0 Posts
I don't think there are any limits. It will just affect your loading time.
__________________
Shane Bauer
Microsoft Certified Professional (MCP) - ASP.NET
ASP/ASP.net, C#, VB/VB.NET, PHP, Perl, SQL
Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiShare on FacebookShare on Stumble UponShare on Twitter
Reply With Quote
  #7 (permalink)  
Old 08-29-03, 12:43 PM
etLux etLux is offline
Newbie Coder
 
Join Date: Aug 2003
Posts: 22
Thanks: 0
Thanked 0 Times in 0 Posts
Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiShare on FacebookShare on Stumble UponShare on Twitter
Reply With Quote
  #8 (permalink)  
Old 09-01-03, 04:34 AM
hari.kara hari.kara is offline
Newbie Coder
 
Join Date: Aug 2003
Location: London, UK
Posts: 5
Thanks: 0
Thanked 0 Times in 0 Posts
Thanks EtLux an d Shane.. Problem solved!
__________________
Be the best you can!
Hari
Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiShare on FacebookShare on Stumble UponShare on Twitter
Reply With Quote
Reply

Bookmarks


Currently Active Users Viewing This Thread: 1 (0 members and 1 guests)
 
Thread Tools
Display Modes

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 Off
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On

Forum Jump

Similar Threads
Thread Thread Starter Forum Replies Last Post
Running a remoted host service. Please help !!! Hynohun The Lounge 10 03-08-04 02:50 PM
BNSOFT.NET - A 16 year old dream kailash Website Reviews 15 09-27-03 06:42 PM
Running Perl scripts under Microsoft IIS retrocom Perl 3 08-23-03 05:38 PM
running website from CD taher786 Script Requests 2 08-20-03 10:04 AM
How can I find out who is running dangerous queries milesfeinberg Database 0 08-13-03 05:18 PM


All times are GMT -5. The time now is 12:18 PM.
vBulletin® Copyright ©2000 - 2012, Jelsoft Enterprises Ltd.