代码之家  ›  专栏  ›  技术社区  ›  Sergej Andrejev

正在删除document.domain

  •  0
  • Sergej Andrejev  · 技术社区  · 14 年前

    specs 在IE8和IE7中使用JavaScript降低域应该是可能的,但是我的代码只在Firefox中工作,并且在IE中抛出一个参数异常。

    <html xmlns="http://www.w3.org/1999/xhtml" >
    <body onload="alert(document.domain); try { document.domain = 'if.se' } catch(e) { alert(e); }; alert(document.domain);">
    </body>
    </html>
    

    编辑

    问题可能是因为两个字母的域。我用三个字母的域(iff.se)进行了测试,结果成功了,但两个字母的域失败了(if.se)

    1 回复  |  直到 13 年前
        1
  •  0
  •   Yuliy    14 年前