[removed] does not change the webpage in IE9?

前端 未结 5 1883
独厮守ぢ
独厮守ぢ 2020-12-17 04:42

I am trying to redirect to a different page in IE9 (9.0.3).

When I try to get/set document.location, or document.location.href, or wi

5条回答
  •  佛祖请我去吃肉
    2020-12-17 05:19

    You should use an absolute URL:

    var url = '/section/page/';
    var host = window.location.hostname;
    window.location = 'http://' + host + url;

    Where url is the relative path to your page.

提交回复
热议问题