Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

window.location in IE base href

I'm having an issue with Internet Explorer and the window.location.

I'm using Backbone.js for my backend project.

The base URL is 'http://www.domain.com/admin/'

And my js function looks like :

openFolder : function(e) {
        var folder_id = '4';
        window.location = "controller/folder/" + folder_id;
    },

So when I'm on the page 'www.domain.com/admin/controller' and I click on a button to open folder, it work well on all browser except for Internet Explorer that redirect me to 'http://www.domain.com/admin/controller/controller/folder/4'

Can you help me with this issue ?

Thank you Ilan

like image 867
Ilan Avatar asked Oct 22 '22 00:10

Ilan


1 Answers

location.href = location.origin + "/controller/folder/" + folder_id;
like image 71
Andrey Ozornin Avatar answered Oct 27 '22 10:10

Andrey Ozornin