Closed Thread Icon

Preserved Topic: XHTML Strict alternative for "target"? (Page 1 of 1) Pages that link to <a href="https://ozoneasylum.com/backlink?for=18520" title="Pages that link to Preserved Topic: XHTML Strict alternative for &amp;quot;target&amp;quot;? (Page 1 of 1)" rel="nofollow" >Preserved Topic: XHTML Strict alternative for &quot;target&quot;? <span class="small">(Page 1 of 1)</span>\

 
Bugimus
Maniac (V) Mad Scientist

From: New California
Insane since: Mar 2000

posted posted 09-22-2002 08:48

How are we supposed to open links in new windows? I can't find an alternative to using target="new" in the anchor tags.

. . : slicePuzzle

u-neek
Bipolar (III) Inmate

From: Berlin, Germany
Insane since: Jan 2001

posted posted 09-22-2002 09:46

onclick="window.open(this.href,'_blank');return false;"

This should work.

mr.maX
Maniac (V) Mad Scientist

From: Belgrade, Serbia
Insane since: Sep 2000

posted posted 09-22-2002 10:25

If you take a look at W3C Mailing List archive, you'll see that W3C people are pretty much ignorant about this "issue". Some of their excuses why target attribute doesn't exist in strict DTD are that it belongs in frameset DTD and that it's often misused for ad popups (and that's actually none of their business). Some people pointed out that by removing target attribute from strict DTD they can?t use it for creating pages for Mozilla/Netscape SideBars (and that a "legitimate" use for target attribute, but the W3C people always pull out that crap about popups and their misuse).

Having in mind all this only thing left is to either use JavaScript (as U-neek suggested above) to open links in new frames or to switch over to XHTML 1.1, which is modularized and you can extend it by yourself...


Bugimus
Maniac (V) Mad Scientist

From: New California
Insane since: Mar 2000

posted posted 09-22-2002 10:39

I'm in a learning mode right now as I try to upgrade some of my pages to XHTML. That's very interesting, mr.maX thanks for the info.

Thanks very much u-neek too, I'll go with the script solution for now.

. . : slicePuzzle

Slime
Lunatic (VI) Mad Scientist

From: Massachusetts, USA
Insane since: Mar 2000

posted posted 09-22-2002 18:46

I believe they also strongly discourage opening pages in new windows, since it disables the back button for one, and someone using a screen reader doesn't visually see that a new window has opened up, so it's inaccessable.

Also, it really confuses the hell out of inexperienced users. They don't know what on earth has happened. It's almost funny. Except when they're your professor.

That said, I'm not sure why they actually left it out.

Bugimus
Maniac (V) Mad Scientist

From: New California
Insane since: Mar 2000

posted posted 09-23-2002 00:55

I won't tell you how upset that kind of thinking makes me sometimes.

Slime
Lunatic (VI) Mad Scientist

From: Massachusetts, USA
Insane since: Mar 2000

posted posted 09-23-2002 01:20

What kind of thing? Popups?

Bugimus
Maniac (V) Mad Scientist

From: New California
Insane since: Mar 2000

posted posted 09-23-2002 01:58

No, people removing valuable features in an attempt to solve problems like the abuse of popups. Cliches like "throwing the baby out with the bath water" and "cutting off one's nose to spite one's face" come to mind.

Slime
Lunatic (VI) Mad Scientist

From: Massachusetts, USA
Insane since: Mar 2000

posted posted 09-23-2002 02:47

Ah. I thought that might be it. But to be honest I doubt that's why they removed it. The W3C is usually very sensible about things like that; it wouldn't be like them to merely remove a feature because they saw that it was being misused.

Looking at this in more detail, I don't see any mention of target in XHTML 1.0, which means that it was supposed to be carried over from HTML 4.01. However, in the list of changes between XHTML 1.0 and 1.1, they say it was removed. So if you're using XHTML 1.0, I'd think it would work.

Hmm. The same page says they removed frames, framesets, iframes, and all that. Interesting. But that's not true, is it? I'm all confused.

Hmm, looks like they removed it from the xhtml 1.0 dtd also without mentioning it. OK. Weird. Looks like mr.Max is completely right... they didn't really give any good reasons for it. Eh.

Bugimus
Maniac (V) Mad Scientist

From: New California
Insane since: Mar 2000

posted posted 09-23-2002 02:57

Well, what I've been doing is just running my pages through the validators as a way to learn as I go. Whenever I hit a snag, that's when I go out and find out what's behind it.

Part of the reason I was doing this was to be able to submit something to Eddie Traversa's contest, because one of the requirements was XHTML compatible code. But now I see that just isn't going to happen. How about you? Were you going to submit a site? Just curious.

. . : slicePuzzle

bitdamaged
Maniac (V) Mad Scientist

From: 100101010011 <-- right about here
Insane since: Mar 2000

posted posted 09-23-2002 03:13

I have to plead ignorance to much of the newest w3c schema's but this does seem silly.

Also can someone explain to me how a target attribute has anything to do with popup ads?

Personally there are many great many usefull uses for these, one example that springs to mind is something like www.fark.com which is a news aggregation site where it's a pain to have to reload the page when it sends you to another story. For that matter any news site where they refrence another page, it's a bad user experience to have someone reading a story about a company and giving them a link to that website without giving them an easy way back.

Silliness in my book.



.:[ Never resist a perfect moment ]:.

Slime
Lunatic (VI) Mad Scientist

From: Massachusetts, USA
Insane since: Mar 2000

posted posted 09-23-2002 03:47

I hadn't planned on entering the contest, no. I rarely enter contests... I can only make things (pov-ray images, dhtml pages, etc) when a randomly occuring bit of inspiration hits me at the same moment that I have some free time. Rarely does that bit of inspiration coincide with the theme of a contest. It's only happened once so far. =)

As for the removal of target, I won't be crying over it. In a way, frames mess up the concept of documents. And opening a document in a new window has nevery been necessary (usually just annoying).

What, specifically, do you need target for? If you really need it, just use the Javascript function window.open(url, target).

Bugimus
Maniac (V) Mad Scientist

From: New California
Insane since: Mar 2000

posted posted 09-23-2002 03:59

I just want to be able to open links in a new window sometimes. A perfect example of that is when I click any link from this board and it opens in a new window. I really like links doing that in some specific cases.

Take this very thread, in fact. When I was typing this reply, I thought I might click the link you posted but if I knew it would take me from this form, I wouldn't have done it until after I posted. This page uses the target attribute.

The particular reason I asked this question was because on my homepage I have a bunch of thumbnails of my Bryce images and I think it makes sense for those to open in a new window so people can just use the "set as background" option.

As for what I'll do, yes, I'm going to just use the solution u-neek gave.

. . : slicePuzzle

Slime
Lunatic (VI) Mad Scientist

From: Massachusetts, USA
Insane since: Mar 2000

posted posted 09-23-2002 04:05

Ah, but you see, shift+clicking or right clicking and going to "open in new window" provides the same functionality, the difference being that the user makes the choice of what happens. When a link is *set* to open in a new window, the user has no choice but to open it in a new window.

Oops, I hadn't seen that uneek already posted that solution.

Bugimus
Maniac (V) Mad Scientist

From: New California
Insane since: Mar 2000

posted posted 09-23-2002 04:17

Hmmm... relying on the savvy user to choose a new window or not may not be such a bad idea. I'll think about that.

bitdamaged
Maniac (V) Mad Scientist

From: 100101010011 <-- right about here
Insane since: Mar 2000

posted posted 09-24-2002 04:29

Just a note if you just do

a href="javascript: window.open(url,name,props)"

you get the same functionality as a target without using the onclick return false stuff.



.:[ Never resist a perfect moment ]:.

Slime
Lunatic (VI) Mad Scientist

From: Massachusetts, USA
Insane since: Mar 2000

posted posted 09-24-2002 04:39

Bit: Please read http://www.youngpup.net/?request=/articles/how-to-create-popups.xml =)

faygo
Obsessive-Compulsive (I) Inmate

From: Detroit, Michigan
Insane since: Feb 2003

posted posted 02-18-2003 20:26

Man oh man, I hardly think it's rude to use opening links in a new window. I am often looking at a persons "Links" page, and I HATE when the links don't open in a new window, always have. Normal links are ok, like links to different parts of a site, but when your linking to, say another blog, you want them to have their own special window, and still have your window open too. I often open links to other blogs in new windows because I'm still investigating the other site. Ya know!?

-Faith
afaith.com

Slime
Lunatic (VI) Mad Scientist

From: Massachusetts, USA
Insane since: Mar 2000

posted posted 02-18-2003 20:58

Well, yes, but that's because you're an experienced computer user.

It's a lot easier for you to hold shift while clicking on links than it is for a new user to figure out what the heck happened when a new window is opened. (Often, they won't even notice that a new window has launched; rather, they'll simply wonder why the "back" button is disabled.)

Regardless, at this point, I don't agree with the W3C's decision to remove framesets/target attributes, simply since they refuse to give a reason as to why they did it. Nonetheless, they did, and we have to live with it.

serf
Neurotic (0) Inmate
Newly admitted

From: UK
Insane since: Mar 2003

posted posted 03-04-2003 14:18

bitdamaged, I don't think you've addressed the whole problem...

Let's say you are posting a form and need the result to come up in a new window...

<script type="text/javascript">
// normaler Woerterbuchaufruf

function fenster_oeffnen() {

fenster = open("http://ponswb.weblink.de/wb/wb.html",\
"WB","width=700,height=600,scrollbars=yes,resizable=yes");
fenster.focus();

}

// -->

</script>

then:

<!-- Pons -->

<form name="fo" onsubmit="fenster_oeffnen();"
action="http://213.221.104.193/cgi-bin/wb/wb.pl"
target="WB" method="POST">

I believe that is not going to work with your solution...

This is an example taken from this page:
http://www.pons.de/home/home.htm

Emperor
Maniac (V) Mad Scientist with Finglongers

From: Cell 53, East Wing
Insane since: Jul 2001

posted posted 03-07-2003 16:37

This:

quote:
onclick="window.open(this.href,'_blank');return false;"



doesn't seem to work properly in IE/Mac as it opens a popup with all the features dsiabled (at least according to Steve). Any thoughts?

___________________
Emps

FAQs: Emperor

InI
Paranoid (IV) Mad Scientist

From: Somewhere over the rainbow
Insane since: Mar 2001

posted posted 03-07-2003 16:42

The poster has demanded we remove all his contributions, less he takes legal action.
We have done so.
Now Tyberius Prime expects him to start complaining that we removed his 'free speech' since this message will replace all of his posts, past and future.
Don't follow his example - seek real life help first.

InI
Paranoid (IV) Mad Scientist

From: Somewhere over the rainbow
Insane since: Mar 2001

posted posted 03-07-2003 16:48

The poster has demanded we remove all his contributions, less he takes legal action.
We have done so.
Now Tyberius Prime expects him to start complaining that we removed his 'free speech' since this message will replace all of his posts, past and future.
Don't follow his example - seek real life help first.

Slime
Lunatic (VI) Mad Scientist

From: Massachusetts, USA
Insane since: Mar 2000

posted posted 03-07-2003 17:12

*Gasp*

Is this the W3C aknowledging the necessity of targets? This is great! Is this new?

Ooh, it's in the XHTML 2 spec. Excellent.

Emperor
Maniac (V) Mad Scientist with Finglongers

From: Cell 53, East Wing
Insane since: Jul 2001

posted posted 03-07-2003 17:19

InI: Yeah that was what I was thinking of - the least hassle way of doing this would be to create a targetBlank() function which you would pass the URL to and the rest would be set in there.

The modular route (using the target module) seems to be the right way to go - it is part of XHTML 2.0 but I thought it was part of XHTML 1.1 strict (I'm just checking). For more resources see:
www.w3.org/TR/xhtml-modularization/abstract_modules.html#s_targetmodule
www.w3.org/TR/xhtml-modularization/

___________________
Emps

FAQs: Emperor

Steve
Maniac (V) Inmate

From: Boston, MA, USA
Insane since: Apr 2000

posted posted 03-07-2003 17:40

Thanks Ini. Guess I'll have to do the extra typing.


Funny - I've never had a "missing feature"problem when using target=_blank to open a new window in html, and whenever I've used javascript to open a new window, it's usually been so I can choose to deliberately omit features - for instance, to open a Flash movie without all the standard browser features. That's why I've never run into this hiccup before.

Now the word had come down from the GN to move onto a brave new world, a world without target=_blank, and only now have I encountered this issue. Live and learn.

I read this article some time ago: the perfect popup, right at about the time I read youngpup's. But again, it seemed that writing a function to specify the desired features was more a matter of choice and control than of necessity. Now I know better.

You PC folk better take note that, if this in fact the case with Mac browsers (that Mac OS window objects are "empty by default"), you can't assume we'll have fully featured windows with the minimal window.open(this.href) syntax.

Slime talks about confused users whose back button no longer works ... imagine their confusion when they don't even *have* a back button int he new window!!!


InI
Paranoid (IV) Mad Scientist

From: Somewhere over the rainbow
Insane since: Mar 2001

posted posted 03-07-2003 17:57

The poster has demanded we remove all his contributions, less he takes legal action.
We have done so.
Now Tyberius Prime expects him to start complaining that we removed his 'free speech' since this message will replace all of his posts, past and future.
Don't follow his example - seek real life help first.

Emperor
Maniac (V) Mad Scientist with Finglongers

From: Cell 53, East Wing
Insane since: Jul 2001

posted posted 03-07-2003 18:02

Steve: The problem is with IE5/Mac not with Mac OS and if MS ever pull their fingers out and provide you with a newer version then it would be fixed.

OK so the solution appears to be:

1. Make a more expansive popup function which explicitly turns everything on.

2. Go for XHTML 1.1+ strict.

[edit: Which, of course, is what mr.maX said on 09-22-2002 - come back we need you!!!!!!!!!!!!!!!!]

I'll sort the function out now and drop it into the FAQ when done.

___________________
Emps

FAQs: Emperor

Emperor
Maniac (V) Mad Scientist with Finglongers

From: Cell 53, East Wing
Insane since: Jul 2001

posted posted 03-07-2003 18:23

OK just threw this together using the GN's popup window generator:

code:
function targetBlank (url) {
blankWin = window.open(url,
'_blank',
'menubar=yes,toolbar=yes,location=yes,directories=yes,
fullscreen=no,titlebar=yes,hotkeys=yes,alwayslowered=yes,
status=yes,scrollbars=yes,resizable=yes,dependent=yes,
channelmode=yes,alwaysraised=yes,zlock=yes,width=,
height=,left=0,screenX=0,top=0,screenY=0');
}



Thoughts?

___________________
Emps

FAQs: Emperor

Emperor
Maniac (V) Mad Scientist with Finglongers

From: Cell 53, East Wing
Insane since: Jul 2001

posted posted 03-07-2003 18:32

I think I forgot to mention that there is an FAQ on this that I have been tweaking as this debate has rolled along:

:FAQ:

___________________
Emps

FAQs: Emperor

InI
Paranoid (IV) Mad Scientist

From: Somewhere over the rainbow
Insane since: Mar 2001

posted posted 03-07-2003 18:40

The poster has demanded we remove all his contributions, less he takes legal action.
We have done so.
Now Tyberius Prime expects him to start complaining that we removed his 'free speech' since this message will replace all of his posts, past and future.
Don't follow his example - seek real life help first.

Perfect Thunder
Paranoid (IV) Inmate

From: Milwaukee
Insane since: Oct 2001

posted posted 03-07-2003 18:53

Really? People left after I left, and now I'm back and we're getting new people all of a sudden. I think it's because my sparkling personality makes the Asylum well worth reading! Not like the rest of you colorless drones.

kuckus
Bipolar (III) Inmate

From: Berlin (almost)
Insane since: Dec 2001

posted posted 03-07-2003 19:16

PT - never thought of it that way yet

Anyway, Emps, I tested your function in my IE 6, and somehow it wouldn't show the address bar unless I turned the 'channelmode' off in the script (i.e. removed that attribute)... so I've put up a quick test page with three links to the GN: one using your original function, the second using the modified one where I took out some attributes that didn't seem necessary and a third one using the good old target="_blank" method:

http://kussatz.com/gurus/targetBlank.html

If some passers-by could tell us how well those work in different browsers that would be cool

[edit: In Mozilla 1.3 they all work the same for me, and as I said IE 6 isn't happy with #1.]

[This message has been edited by kuckus (edited 03-07-2003).]

Emperor
Maniac (V) Mad Scientist with Finglongers

From: Cell 53, East Wing
Insane since: Jul 2001

posted posted 03-07-2003 20:48

kuckus: Thanks a lot much appreciated - channelmode must be some odd option (like fullscreen) that seems worth switching off - interesting effect though.

InI & PT: Thats odd I only ever blamed you two for the terrible state of the toilet block at the end of your corridor ~shrug~

[edit: I've updated the FAQ]

___________________
Emps

FAQs: Emperor

Steve
Maniac (V) Inmate

From: Boston, MA, USA
Insane since: Apr 2000

posted posted 03-07-2003 20:59

FWIW, all three of kuckus' examples worked fine for me.

Once you have the function finalized, I'll add it to the head of my approval texts and toss that up to beat up on. Thanks for all the help!

InI
Paranoid (IV) Mad Scientist

From: Somewhere over the rainbow
Insane since: Mar 2001

posted posted 03-10-2003 22:20

The poster has demanded we remove all his contributions, less he takes legal action.
We have done so.
Now Tyberius Prime expects him to start complaining that we removed his 'free speech' since this message will replace all of his posts, past and future.
Don't follow his example - seek real life help first.

« BackwardsOnwards »

Show Forum Drop Down Menu