Welcome to ShenZhenJia Knowledge Sharing Community for programmer and developer-Open, Learning and Share
menu search
person
Welcome To Ask or Share your Answers For Others

Categories

I have a problem with window.location.href.

I'm trying to redirect to a page with the following code:

window.location.href = "juego.html"+'?modoJuego='+modoJuego+"&etapa="+etapa+"&rango="+rango;

It works perfectly on Firefox and Chrome, however in IE10 the browser freezes and I have to restart it. Sometimes it redirect to the desired page, but the parameters do not pass through. I have been looking for a solution, for example this one:

Window.Location Not Working In IE?

But the proposed solution do not work for me.

Do somebody know how to deal with this?

See Question&Answers more detail:os

与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…
thumb_up_alt 0 like thumb_down_alt 0 dislike
605 views
Welcome To Ask or Share your Answers For Others

1 Answer

The problem is likely due to the value of your variables. If they contain special or invalid characters, those needs to be passed through encodeURIComponent before being assigned to window.location.href.


与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…
thumb_up_alt 0 like thumb_down_alt 0 dislike
Welcome to ShenZhenJia Knowledge Sharing Community for programmer and developer-Open, Learning and Share
...