Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations SkipVought on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Javascript redirect delay

Status
Not open for further replies.

Techieish

Technical User
Jul 2, 2007
1
0
0
US
I have this code for a loading page and i want to delay it instead of it going right away. I have it in the head of my page and i want to delay it 5000 milliseconds. Thanks

<script type="text/javascript">
function detectBrowser()
{
var browser=navigator.appName
var b_version=navigator.appVersion
var version=parseFloat(b_version)
if ((browser=="Microsoft Internet Explorer"))
window.location = "else
window.location = "}
</script>
 
Just give a timeout everywhere that function is called and then you don't need to change the function itself which has a self-sufficient and clear purpose of its own.
[tt]
//take out and replace
[red]//[/red]detectBrowser();
setTimeout("detectBrowser()",5000);
[/tt]
 
Why not write a site that is cross-browser compatible? I see nothing on your site which shouldn't be do-able in most browsers without the need for this sort of browser detection.

Dan



Coedit Limited - Delivering standards compliant, accessible web solutions

[tt]Dan's Page [blue]@[/blue] Code Couch
[/tt]
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top