Welcome to WebmasterWorld Guest from 54.162.239.134

Forum Moderators: open

Message Too Old, No Replies

Alternative to target _blank or JS for popups

validating large-image pop-ups

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

WebmasterWorld Administrator ergophobe is a WebmasterWorld Top Contributor of All Time 10+ Year Member Top Contributors Of The Month



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

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

WebmasterWorld Senior Member tedster is a WebmasterWorld Top Contributor of All Time 10+ Year Member



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;">

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

WebmasterWorld Administrator ergophobe is a WebmasterWorld Top Contributor of All Time 10+ Year Member Top Contributors Of The Month




<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

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

10+ Year Member



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?

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

WebmasterWorld Administrator ergophobe is a WebmasterWorld Top Contributor of All Time 10+ Year Member Top Contributors Of The Month




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

 

Featured Threads

Hot Threads This Week

Hot Threads This Month