On 1/23/08, Jeff Walden <[EMAIL PROTECTED]> wrote:
> The spec as currently written says that document.domain in a document located 
> at a URI with no domain is null:
>
> data:text/html,<script>alert(document.domain);</script>
>
> Safari and Opera both alert the empty string for this

I like Safari and Opera's way because .domain always returns a string,
which makes sense to me from a type perspective (at least in
javascript).

However, Firefox is probably right because in the case of no domain,
there's no domain string to return, so null is returned. This is also
what PHP's DOMDocument->domain returns.

Just would be nice if all browsers did the same here.

-- 
Michael

Reply via email to