Re: [techs] EXTENDED Techniques Teleconference 17 November 2004

James Craig wrote:

>> Better yet, the return value should be determined by the pop-up
>> function, so that certain pop-up blockers don't deny access.

To which Jim Ley replied:

> NO!  the first is clearly the correct method, you must not return
> false from the onclick handler unless you know the window has
> successfully been opened, there is no way to know this, it cannot be
> determined by the pop-up function.

Sure it can. By assigning the window.open() return value to a variable, 
the script has a reference to the new window object. The pop-up 
function can then check to see if the new window exists before sending 
its return value to the calling link.

There is a working version here.
   <http://cookiecrook.com/AIR/2003/train/xmp/popup/popup.htm>

Along with a commented script file:
   <http://cookiecrook.com/AIR/2003/train/xmp/popup/pop.js>

And more explanation of the problem and solution:
   <http://cookiecrook.com/AIR/2003/train/jsexamples.php>

Cheers,
James Craig

PS. Can we just completely remove the 'target' attribute from that 
Techniques example (2.1)? Isn't it invalid XHTML 1.1 and 1.0 Strict?

-- 
http://cookiecrook.com/

Received on Saturday, 20 November 2004 17:57:22 UTC