Solved

Need two functions to run on window.onload.  How do I that?

Posted on 2012-03-18
4
215 Views
Last Modified: 2012-03-20
Hello,

I need two functions to run on window.onload.  Currently, only the first one listed runs.  How do I get the second one to run?

window.onload = getState;  SelectSchoolType;
0
Comment
Question by:NewWebDesigner
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
  • 2
4 Comments
 
LVL 57

Assisted Solution

by:giltjr
giltjr earned 250 total points
ID: 37736019
Two different ways to try:

window.onload = function() {
  getState;
  SelectSchoolType;
}

Or create a nother function called say DoTwo like:

function DoTwo {
getState;
SelectSchoolType;
}

window.onload = DoTwo ;

Then do
0
 
LVL 82

Accepted Solution

by:
leakim971 earned 250 total points
ID: 37736081
@giltjr, you miss parentheses, it should be :

window.onload = function() { 
  getState();
  SelectSchoolType();
}

Open in new window

or :
window.onload = DoTwo ;

function DoTwo() {
getState();
SelectSchoolType();
}

Open in new window

0
 
LVL 57

Expert Comment

by:giltjr
ID: 37736117
Thanks leakim971 for correcting my samples.
0
 
LVL 10

Expert Comment

by:d4durvesh
ID: 37739058
use jquery to do that...
0

Featured Post

Salesforce Made Easy to Use

On-screen guidance at the moment of need enables you & your employees to focus on the core, you can now boost your adoption rates swiftly and simply with one easy tool.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

The task A number given should be formatted for easy reading by separating digits into triads. Format must be made inline via JavaScript, i.e., frameworks / functions are not welcome. So let’s take a number like this “12345678.91¿ and format i…
Having worked on larger scale sites, we found out that you are bound to look at more scalable solutions to integrating widgets, code snippets or complete applications and mesh them into functional sites, in any given composition. To share some of…
The viewer will learn the basics of jQuery, including how to invoke it on a web page. Reference your jQuery libraries: (CODE) Include your new external js/jQuery file: (CODE) Write your first lines of code to setup your site for jQuery.: (CODE)
The viewer will learn the basics of jQuery including how to code hide show and toggles. Reference your jQuery libraries: (CODE) Include your new external js/jQuery file: (CODE) Write your first lines of code to setup your site for jQuery…

689 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question