Want to win a PS4? Go Premium and enter to win our High-Tech Treats giveaway. Enter to Win

x
?
Solved

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

Posted on 2012-03-18
4
Medium Priority
?
217 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 1000 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 1000 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

Concerto Cloud for Software Providers & ISVs

Can Concerto Cloud Services help you focus on evolving your application offerings, while delivering the best cloud experience to your customers? From DevOps to revenue models and customer support, the answer is yes!

Learn how Concerto can help you.

Question has a verified solution.

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

International Data Corporation (IDC) prognosticates that before the current the year gets over disbursing on IT framework products to be sent in cloud environs will be $37.1B.
Nothing in an HTTP request can be trusted, including HTTP headers and form data.  A form token is a tool that can be used to guard against request forgeries (CSRF).  This article shows an improved approach to form tokens, making it more difficult to…
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…

610 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