location.origin兼容IE
程序员文章站
2022-07-05 15:18:50
if (window["context"] == undefined) { if (!window.location.origin) { window.location.origin = window.location.protocol + "//" + window.location.hostna... ......
if (window["context"] == undefined) { if (!window.location.origin) { window.location.origin = window.location.protocol + "//" + window.location.hostname + (window.location.port ? ':' + window.location.port: ''); } window["context"] = location.origin+"/v6.0"; } if (!window.location.origin) { window.location.origin = window.location.protocol + "//" + window.location.hostname + (window.location.port ? ':' + window.location.port: ''); }