|
Posted by Gιrard Talbot on 06/29/05 02:14
Michael Winter wrote :
> On 28/06/2005 23:24, GΓ©rard Talbot wrote:
>
> [snip]
>
>> It's better to set the global variable to null and not to undefined.
>
>
> I fail to see why. The variable will type-convert to boolean false in
> just the same way, and the code that you cite doesn't attempt to make
> any distinction between two values.
>
It's better to initialize the variable to null rather to undefined as
later parts of the code test for/compare the reference to null and not
to undefinded. You avoid the browser to type convert that. It's no biggie.
> The rest I agree with, though if we're talking best practices, the code
> suggested by Mozilla should also test to make sure that the open and
> focus methods exist before calling them
There is no browser that supports window.open() that does not support
window.focus().
in case a user is using a proxy
> or third-party pop-up blocker that effectively deletes or fakes the
> former, thus making the latter non-existent.
>
> [snip]
>
> Mike
>
I'm not saying you're wrong about what you say up here about open being
faked: I just do not know about that particular issue.
[...After deeper thinking...] If open() is faked, then
WindowObjectReference will be null and the WindowObjectReference.focus()
will create a js error.
GΓ©rard
--
remove blah to email me
Navigation:
[Reply to this message]
|