homepage Welcome to WebmasterWorld Guest from 54.166.8.138
register, free tools, login, search, pro membership, help, library, announcements, recent posts, open posts,
Become a Pro Member

Visit PubCon.com
Home / Forums Index / Code, Content, and Presentation / JavaScript and AJAX
Forum Library, Charter, Moderator: open

JavaScript and AJAX Forum

    
Alternative to target _blank or JS for popups
validating large-image pop-ups
ergophobe




msg:1478888
 8:23 pm on Jun 17, 2002 (gmt 0)

I've been experimenting on my personal site trying to get everything to use fully validating XHTML 1.0 Strict and CSS for all layout, etc. One problem is that I want to show a thumbnail and then have it show a larger version in a popup window that the user closes when done viewing. The two "old" methods would be
1. target="_blank"
or

2. Javascript

but neither of these validate (the first because it is deprecated, the second because of accessibility issues).

Does that mean that one must simply not use popups if you want your page to validate, or is there some other solution?

Tom

 

tedster




msg:1478889
 10:21 pm on Jun 17, 2002 (gmt 0)

Validation depends on which DTD you choose.

There's been some confusion about the target attribute, because it's not included in the strict HTML4 DTD, only the transitional and frameset declarations. But from everything I read at the W3C, it's not deprecated.

Javascript is also a solution and you can make it accessible to non-js visitors like this:

<a href=[url here] onClick="[popup function here];return false;">

ergophobe




msg:1478890
 10:43 pm on Jun 17, 2002 (gmt 0)


<a href=[url here] onClick="[popup function here];return false;">

I could make that work. The way I do it now is I have a javascript function create a page on the fly, so there isn't really a URL.

I guess I could create it on the fly via javascript for those who have it enabled or send GET params and create the page on the fly from a template using PHP, though that means the page has to have all the navigation and all that stuff and sort of disrupts reading of a story.


on which DTD you choose.

Like I said, I'm trying to validate to XHTML 1.0 Strict which does not allow the target attribute.

Tom

rewboss




msg:1478891
 5:50 am on Jun 18, 2002 (gmt 0)

As has been said, there is confusion over the target attribute. There are one or two things you can do:

1. Abandon the idea of a popup. Oh well. There are issues involved with them anyway, they tend to clutter people's taskbars and many designers consider popup windows in whatever form to be bad and/or tacky design. ::shrug::

2. Ignore the problem. It's not as if there are many browsers out there that would choke on it -- all it means is that you can't put a W3C icon on your site (which I think is pretentious anyway: how many of your visitors actually care what W3C thinks, as long as it works for them?).

3. Use the transitional DTD. After all, what's wrong with validating to a transitional DTD? It's still valid, you can have your W3C icon, the page will work properly, so why bang your head against a brick wall on a matter of principle?

ergophobe




msg:1478892
 6:17 pm on Jun 18, 2002 (gmt 0)


Abandon the idea of a popup

I've certainly considered that. I wish there was (read: I wish I knew) a good way to "zoom" a picture without interupting the flow of a text article. A modal popup that the user closes when finished is pretty heavy-handed but ultimately seems like the least intrusive in that specific case (link warns that new window will open etc etc).


you can't put a W3C icon on your site

I don't really care about that, but about the principle. This is just for a small personal site. In fact, the content is secondary, the goal is as much (or more) to think through some of these issues as to actually put anything on the web.


why bang your head against a brick wall on a matter of principle?

Because I have a hard head. I end up spending a lot on bricks, but my head's doing okay. Anyway, like I say, it really is a matter of principle and experimentation and not meant to be practical at all. I mostly want to see what it takes to get something that goes all the way with validation of all sorts.

Tom

Global Options:
 top home search open messages active posts  
 

Home / Forums Index / Code, Content, and Presentation / JavaScript and AJAX
rss feed

All trademarks and copyrights held by respective owners. Member comments are owned by the poster.
Home ¦ Free Tools ¦ Terms of Service ¦ Privacy Policy ¦ Report Problem ¦ About ¦ Library ¦ Newsletter
WebmasterWorld is a Developer Shed Community owned by Jim Boykin.
© Webmaster World 1996-2014 all rights reserved