Jump to content

target="_blank" in XHTML


AXiSS

Recommended Posts

See, this is why validation is silly....

 

Why? This is all in line with web standards. Opening a page in a new window is most definitely a document efect and as such should be implemented with javascript. The window.open(this.href); retrun false; method is perfect because it allows js to control the effect and degrades when js is off to opening in teh current window.

 

If you want to use the target attribute and remove the document from the realm of js control then just use a different doctype its not compicated. If you are using a strict doctype then code as such - as compliant browsers SHOULD fail if you don't (unfortunatley they still work!!!!!)

Link to comment
Share on other sites

Frames DON'T have a target in xhtml1.1. Target is NOT a valid attribute for a frame (and never has been). A frame has a name or id that in html can be referenced to using the target attribute of a anchor.

 

Standards however consider any content not loading into the current window a document effect; and if you are clicking a link in one frame to do something in another then that is classed as a document effect - hence javascript should control that.

Link to comment
Share on other sites

I meant that you can target anchors... which should always work, even with JS off... it's been around for a decade without JS.

 

Yes but as opening a new window is considered a document it should be controlled by js. Standards state that you xhtml/html should be the page content, the design be done in css and the doc effects in js. xhtml should NOT control any documenst effects - thats why the target attribute was no included in the xhtml1.1 standard (nor xhtml1.0 if my memory serves me right.)

Link to comment
Share on other sites

fenway, I used to think like you do, but I now know better. Standards are a good thing. They make authoring a webpage so much easier.

If you want to use the target attribute, then either use a different common doctype or create your own. The original poster decided to use xhtml 1.1 strict, then that person should code to that standard.

Your knowledge, expertise and willingness to help with sql is admired, but as you know, how you do something in MySQL 3 might be different in MySQL 5, this is kind of like how it is in xhtml 1.1 strict or html 3, if you decide to use one over the other, than you need to follow those standards.

I prefer to use xhtml 1.1 strict, since IE follows that a little closer than the other standards and it makes it a little easier to add a few hacks to make IE look the same as opposed to other standards. Oh, and for the original poster, yes I do mean IE, not FireFox. FireFox is not perfect with its standards, but it is a lot closer than IE.

Link to comment
Share on other sites

Yes, it would be easier, but you won't get the same results in all browsers, whereas if you had standards then your page would look like you want it to look in all browsers.

If you want to code in your own way, you could just make your own doctype and have the browsers follow that standard.

Link to comment
Share on other sites

Errmm Whats XHTML?

 

PM Thnx

 

Tarun

 

Seeing as you're an HTML expert (according to your signature) you really should have heard about XHTML. While HTML is short for HyperText Markup Language, XHTML is short for Extensible HyperText Markup Language. XHTML is meant to supersede HTML and uses a XML structure (really ultra short description). More information here.

Link to comment
Share on other sites

Yes, it would be easier, but you won't get the same results in all browsers, whereas if you had standards then your page would look like you want it to look in all browsers.

If that were even true at all, I might actually consider using them...

Link to comment
Share on other sites

its not true but the use of standards will give 'better' results across browsers. You will produce a site that is much closer in look and feel on many browsers.

 

Honestly, I have not used a hack in css for some time now  (alothough I don't support ie 5.5 these days) and nor do I use any scripts to switch style sheets - one sheet and the same html served to all devices - and the results are pretty damn good even if I do say so.

 

I promise you - switch to strict xhtml 1.0 or better still  xhtml 1.1, use only valid mark up, stick ALL style in css and leave ALL doc effects to js - ensuring they degrade nicely (I use ajax alot for this as it also reduces the server load a little and improves user experience vastly) and in a few weeks you will sit back and wonder why the hell you didn't make the switch sooner...

 

That is a promise.

Link to comment
Share on other sites

This thread is more than a year old. Please don't revive it unless you have something important to add.

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Restore formatting

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.