Ilan
Ilan

Reputation: 579

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

Upvotes: 5

Views: 3532

Answers (1)

Andrey Ozornin
Andrey Ozornin

Reputation: 1158

location.href = location.origin + "/controller/folder/" + folder_id;

Upvotes: 3

Related Questions