There's no question about the coolness of Chris Heilmann's DOMinclude script (hint: it's very cool). DOMinclude provides an
alternative to pop-ups by generating a new "layer" inside the browser window. Now, that being said, I don't
mean to sound like I'm throwing stones at someone who is a much more accomplished developer than I (here comes the
obligatory "but"), but... First of all, I have to question the veracity of this statement:
[Y]ears of unsolicited pop-up windows have conditioned users to immediately close windows when they open.I'm not sure about that. Unwanted pop-ups, definitely. But user-initiated pop-ups, especially when it's explicitly stated that the target is going to open in a pop-up? I don't know anyone who immediately closes those. Now, I certainly don't think pop-upitis is a good thing (and neither is getting trigger happy with
target="_blank"), but it is possible for pop-ups to serve a useful
purpose. Second, how will this affect pages built with the XHTML Strict doctype? DOMinclude creates its faux pop-ups by manipulating iframes, and iframes aren't valid in Strict.
And third, when I view the DOMinclude demo (click "Phillip Pullman: The Amber Spyglass"), I get some brief flickering as the iframe is repositioned. Perhaps this issue could be resolved using Pat Fitzgerald's technique for eliminating redisplay flashes.
My M.O. for dealing with requests to "make this page open in a pop-up" is to first find out if there is no other way to accomplish the desired result; pop-ups, like Old Spice, should be used sparingly. Then, if it's determined that I absolutely must use a pop-up, my standard code to do so goes something like this:
<a href="http://somepage.com" target="_blank"
onclick="window.open(this.href,'popup','scrollbars,resizable,width=300,height=400'); return false">Open
pop-up</a> Or if I'm dealing with more than just a simple, isolated pop-up, I'll make into a
function a la A List Apart's Accessible Pop-up Links. What do you think? Am I behind the times, and DOMinclude is the way to go? Or is there a time and a place for both DOMinclude and accessible pop-ups triggered by old-fashioned onclick events?








1. My favorite use of popups (is this what you're asking for) is how USBank Online uses them to display electronic copies of your checks that have been submitted for payment. I can click on one check, look at it, then click on another check, which will load in the same popup. Very efficient.
WellsFargo, on the otherhand, uses a straight clickthru, which requires me to navigate Back to the online statement.
I didn't see any real flash on the DOMInclude demo, but the text did shuffle as the word "Hide" was inserted into the link ("this photo of a confused puppy").
Posted at 3:44PM on Mar 29th 2006 by Lance Lavandowska