I always get the last onload function, but I need both, Is there any other alternate option without removing any of window.onload event?
window.onload = function(){
alert("first");
}
window.onload = function(){
alert("second");
}
Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.
Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.
Lost your password? Please enter your email address. You will receive a link and will create a new password via email.
Please briefly explain why you feel this question should be reported.
Please briefly explain why you feel this answer should be reported.
Please briefly explain why you feel this user should be reported.
When declaring the second one, you can chain with the first.
You also can make an utility like this :
You’d call it like this :
EDIT : or you may simply do what ThiefMaster suggests… (I’ll upvote him !).