我遇到了Internet Explorer和window.location的问题。
我正在将Backbone.js用于我的后端项目。
基本网址为“http://www.domain.com/admin/”
我的js功能看起来像:
openFolder : function(e) {
var folder_id = '4';
window.location = "controller/folder/" + folder_id;
},
所以当我在页面'www.domain.com/admin/controller'上并点击一个按钮打开文件夹时,它在所有浏览器上运行良好,除了将我重定向到的Internet Explorer 'http://www.domain.com/admin/controller/controller/folder/4'
你能帮我解决这个问题吗?
谢谢 伊兰
答案 0 :(得分:2)
location.href = location.origin + "/controller/folder/" + folder_id;