Problems When redirecting page with angularjs in IE

2

I have the following script to redirect to the page I want

if (!window.location.origin) {
    window.location.origin = window.location.protocol + "//" 
        + window.location.hostname 
        + (window.location.port ? ':' + window.location.port : '');

      $location.$$urlUpdatedByLocation = true; 
      $location.$$absUrl = window.location.origin+location.pathname+"busqTerceros.html";

}else{
    $location.$$urlUpdatedByLocation = true;
    $location.$$absUrl = location.origin+location.pathname+"busqTerceros.html";
}

In my case I have problems redirecting with IE (Internet Explorer), the path I am using is window.location.origin+location.pathname+"busqTerceros.html"

It's weird because if I just left the route window.location.origin+location.pathname takes me to a route without generating a loop that would be a route similar to this https://localhost:8080/algo/

But if I add the concatenation +"busqTerceros.html" an infinite loop is generated.

In the file busqTerceros.html I have the following:

   <meta http-equiv="refresh" content="0; url=/algo/#!/algo" />

PS: by the way it enters the IF when it is internet explorer because originally I did not recognize the location.origin that's why I had to create it like this.

    
asked by Ikabod 15.11.2018 в 20:52
source

0 answers