某些IE浏览器location.origin属性是undefined,所以如果你要使用该属性,那么要注意做个能力检测。

    <br />if (!window.location.origin) {<br /> window.location.origin = window.location.protocol + "//" + window.location.hostname + (window.location.port ? ':' + window.location.port: '');<br />}<br />