开发者

Can window.location change from https to http

I have a store receipt window in https. I want to use window.location to change the location from https to http.

I have code like this.

var currentHost = window.location.host;
window.location.href = "http://" + currentHost + "/store/closeStoreWindow?gotoUri=" + url

It goes to the url I expect, but it still is https. It's like some securit开发者_如何学编程y thing is blocking a change in protocol.

Should this work?


Opps. I think I may have discovered a filter in the app that is causing it to redirect back to https. So the window.location probably works just fine. Sorry about that.


server might be forced to use always HTTPS. If this is the case you cannot change this from your client side JavaScript. If your code passes required URL and you get a response from HTTPS then this is the case.

Ivo Stoykov

0

上一篇:

下一篇:

精彩评论

暂无评论...
验证码 换一张
取 消

最新问答

问答排行榜