window.location.href not working on IE

internet-explorer, javascript

Solution

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`.

Problem

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?

Original source

Related problems