Click here to Skip to main content
15,867,686 members
Please Sign up or sign in to vote.
1.00/5 (1 vote)
See more:
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
Updated 2-Apr-18 21:43pm
Comments
StianSandberg 20-Jul-12 8:06am    
what happens if you run the code in chrome? javascript-error? nothing?
Venkat_C6 20-Jul-12 8:08am    
nothng
Venkat_C6 20-Jul-12 8:34am    
Hey I got it. I gave setTimeOut with half second delay then its working...

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

C#
setTimeout(function(){document.location.href = "page.html;"},500);
 
Share this answer
 
v2
Comments
Member 8791667 15-Jan-20 1:22am    
having a timeout value of 0 should also work, it did for me
You can go with the following code instead of location.href.

window.location.assign("link to next page")
 
Share this answer
 
Comments
Member 8765679 2-Jun-13 15:16pm    
Solution 1 works for all browsers - use it
window.location = "your full link";
 
Share this answer
 

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

  Print Answers RSS
Top Experts
Last 24hrsThis month


CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900