| | |
Redirecting a browser with Javascript....
Please support our JavaScript / DHTML / AJAX advertiser: PostgreSQL or MySQL? Compare and contrast the two most popular open source databases
![]() |
Hello everyone. Does anyone know if it is possible to redirect a browser with Javascript? If it is, could someone please give me a clue as to how it is done? I have searched the w3schools tutorial where I started learning Javascript but can't find anything on this. Any help would be appriciated. Thanks.
Steven.
Steven.
A Google for "javascript redirect" would have answered yor question much quicker than posting here.
JavaScript / DHTML / AJAX Syntax (Toggle Plain Text)
window.location="http://www.yourdomain.com/";
If I've been a help please confirm by clicking the Add to Lafinboy's Reputation link in the header of this reply.
Lafinboy Productions
:: Website Design :: Website Development ::
Lafinboy Productions
:: Website Design :: Website Development ::
This code is used specifically to redirect one Web page to another (i.e. if your Web site has moved, put this code at the old location)
I hope that helps you out.
<html>
<head>
<title>Redirect JavaScript-browsers</title>
<script language="JavaScript">
<!-- Beginning of JavaScript --------
this.location = "http://www.newsite.com";
// -- End of JavaScript code -------------- -->
</script>
</head>
<body>
This site is now located at <a href="http://www.newsite.com">http://www.newsite.com</a>.
</body>
</html>
I hope that helps you out.
Last edited by FC Jamison; Aug 3rd, 2006 at 6:46 am. Reason: To indicate post as a solution
![]() |
Similar Threads
- Javascript menu blocked by browser what can I do for alternative (JavaScript / DHTML / AJAX)
- "<SCRIPT SRC>" javascript logon help (JavaScript / DHTML / AJAX)
- JavaScript/DHTML newbie -- general questions (JavaScript / DHTML / AJAX)
- JavaScript's window.opener (JavaScript / DHTML / AJAX)
- Cannot click JavaScript links (Web Browsers)
Other Threads in the JavaScript / DHTML / AJAX Forum
- Previous Thread: Smart Mind "FLOAT EVERYTHING"
- Next Thread: Null hyperlink: OK?
| Thread Tools | Search this Thread |
ajax ajaxcode ajaxexample ajaxhelp ajaxjspservlets animate array automatically browser bug calendar captchaformproblem cart checkbox child class close codes createrange() cursor date debugger dependent disablefirebug dom dropdown editor element embed engine events explorer ext file firefox form forms getselection google gxt hiddenvalue highlightedword hint html htmlform ie7 ie8 iframe images internet java javascript javascripthelp2020 jawascriptruntimeerror jquery jsf jsfile jsp jump libcurl maps masterpage math media microsoft object onmouseoutdivproblem onreadystatechange parent paypal pdf php player position post programming progressbar prototype redirect regex runtime safari scale scriptlets scroll search security shopping size software sql text textarea toggle unicode web website windowsxp wysiwyg \n






