views:

52

answers:

1

What am I doing wrong? According to specs lowering domain with javacript should be possible in IE8 and IE7 but my code only wors in FF and throws Argument Exception in 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>

Edit

The problem might be because of two letter domain. I tested with three letter domain (iff.se) and it worked, but two letter domain failed (if.se)

A: 

It's probably getting caught inside a sanity check to make sure you don't try and set document.domain to co.uk or something silly like that.

Yuliy
this woureally sad. Maybe you have and idea where I can get documentation regarding this issue?
Sergej Andrejev