Andrew said:
Hi all
Are there any compatibilty issues associated with
teh following command?
<div onclick="open('
http://www.mysite.com.htm','','')">Main page </div
Yes.
It worked on a PC butnot on a MAC (bith with IE).
The unqualified identifier - open -, executed form on event handler,
will be resolved against the scope chin of the event handler function.
Browsers construct different custom scope chains for the event handling
functions that they construct (from attribute strings), and those scope
chains may or may not include the - document - object, which has an -
open - method of its own. If Mac IE places the - document - on the DIVs
onclick handler's scope chain then the method called will be -
document.open - instead of - window.open -. Not relying on identifier
resolution against the scope chain when placing code in HTML event
handling attribute strings avoids the problem (i.e. use - window.open -
in this case).
All calls to - window.open - may be subject to pop-up blocking
mechanisms of various sorts, and thus may not work on all
machines/configurations even with the same browser.
Very old browsers (e.g. Netscape <= 4) may not implement onclick
handlers on normal DIV elements.
Richard.