.NET Tutorials, Forums, Interview Questions And Answers
Welcome :Guest
 
Sign In
Register
 
Win Surprise Gifts!!!
Congratulations!!!


Top 5 Contributors of the Month
david stephan

Home >> Forum >> JavaScript/VBScript >> Post New QuestionBookmark and Share Subscribe to Forum

how to call a another page in onload in javascript

Posted By: jay     Posted Date: February 24, 2010    Points:2   Category :JavaScript/VBScript
take ex i have first.html and second.html page

when i open first.html it should redirect me to second.html on load of first.html page.
in javascript

Responses
Author: Lalij Mer          Accepted Answer   
Posted Date: February 24, 2010     Points: 10   

This example is setup to redirect to another page in 2 seconds. When a page contains this JavaScript, it will be redirected to another page that you specify in the "window.location=". You can change the number of refresh seconds by changing the "move()',2000 to the number of seconds you'd like.

Example:

1000 = 1 second
3000 = 3 seconds



Place this code between the <head> and </head> tags
<script language="JavaScript">
<!--Script courtesy of http://www.web-source.net - Your Guide to Professional Web Site Design and Development
var time = null
function move() {
window.location = 'http://www.yourdomain.com'
}
//-->
</script>



Place this code in your <body> tag
<body onload="timer=setTimeout('move()',2000)">


Please Check my answer if you help....
Thank You...

Lalit.
Author: jay             
Posted Date: February 24, 2010     Points: 5   

thank u lalit.. its workin..

regards
jay

Author: jay             
Posted Date: February 24, 2010     Points: 5   

hi lalit can u send me all the methods and properties of wondow



Post Reply

You must Sign In To post reply
 
 
Find more Forum Questions on C#, ASP.Net, Vb.Net, SQL Server and more Here
Quick Links For Forum Categories:
ASP.NetWindows Application  .NET Framework  C#  VB.Net  ADO.Net  
Sql Server  SharePoint  OOPs  SilverlightIISJQuery
JavaScript/VBScriptBiztalkWPFPatten/PracticesWCFOthers
www.DotNetSpark.comUnAnsweredAll

Hall of Fame    Twitter   Terms of Service    Privacy Policy    Contact Us    Archives   Tell A Friend