Click here to Skip to main content
11,502,559 members (63,514 online)
Rate this: bad
good
Please Sign up or sign in to vote.
See more: Javascript
Hi all,

window.location.href (or) document.location.href is not working in Chrome. Is there any alternation? Please help me its urgent. I had searched in google but I din't get exactly.

Thanks...
Posted 20-Jul-12 2:04am
Comments
AlluvialDeposit at 20-Jul-12 8:06am
   
what happens if you run the code in chrome? javascript-error? nothing?
Venkat_C6 at 20-Jul-12 8:08am
   
nothng
Venkat_C6 at 20-Jul-12 8:34am
   
Hey I got it. I gave setTimeOut with half second delay then its working...
Rate this: bad
good
Please Sign up or sign in to vote.

Solution 1

Hi frnds I got it. I used setTimeout then its working in all browsers.

setTimeout(function(){document.location.href = "page.html;"},500);
  Permalink  
v2
Rate this: bad
good
Please Sign up or sign in to vote.

Solution 2

You can go with the following code instead of location.href.

window.location.assign("link to next page")
  Permalink  
Comments
Member 8765679 at 2-Jun-13 15:16pm
   
Solution 1 works for all browsers - use it

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)



Advertise | Privacy | Mobile
Web04 | 2.8.150520.1 | Last Updated 20 May 2014
Copyright © CodeProject, 1999-2015
All Rights Reserved. Terms of Service
Layout: fixed | fluid

CodeProject, 503-250 Ferrand Drive Toronto Ontario, M3C 3G8 Canada +1 416-849-8900 x 100