What replaces target= ?

T

Trevor Lawrence

I have been verifying my website at http://validator.w3.org/

While there are some other problems, one that keeps coming up is that these
are both invalid in Strict HTML 4.01
<base target=".......">
<a href="......." target ="........">

When the error is an invalid tag e.g. <u> or an invalid attribute e.g.
align= , I have generally been able to find a CSS alternative.

But what can I do about target = ?
Or does 4.01 not support any target other than a new page (_blank) ?
 
R

Ronx

From what I read on w3.org, the target attribute is valid in HTML4.01 in
Framed pages, and
http://www.w3.org/TR/1999/REC-html401-19991224/present/frames.html#h-16.3.1
shows an example using HTML 4.01 Transitional. However,
http://www.w3.org/TR/1999/REC-html401-19991224/index/attributes.html shows
the target attribute is only valid in a frameset with frameset DTD.
Since target is used for frames, and frames are only valid in the
transitional and frameset DTDs for 4.01, target may not be valid in Strict.

The alternative is a javascript pop-up window. Or change to Transitional
doctype. Or ignore the error.
--
Ron Symonds
Microsoft MVP (Expression Web)
http://www.rxs-enterprises.org/fp

Reply only to group - emails will be deleted unread.
 
J

Jon Spivey

In theory javascript, eg
<a href="page.htm" onclick="window.open(this.href); return false;">click</a>

Fair to assume many people still use target :)
 
H

Hot-text

You do not need a target=_self or target=_parent or target=_top
on or web site..... they are invalid error if there no frame or Iframe names
to target for
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Frameset//EN"
"http://www.w3.org/TR/html4/frameset.dtd">


But you have a target="_blank" it ok to Pop-up a page for it not a invalid
error for
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">

target=_ names or not invalid error!
 
T

Trevor Lawrence

Thanks to all

I found out that target is invalid in Strict 4.01 (which is why I posted)
but it does make a difference whether target is "_self" or "_blank" - the
target does not have to be a frame name (clearly using Quirks mode)

I am now using the default (equivalent to "_self")

When I want "_blank" I am using Jon's idea:
<a href="page.htm" onclick="window.open(this.href); return false;">click</a>
except that I use <a href="#" ........
(This idea did occur to me after I posted and before Jon replied so thanks,
Jon for confirming that for me)

Perhaps it would be better to use page.html, where this contains a message
"You don't have Javascript turned on"
(or similar)
 
H

Hot-text

"You don't have Javascript turned on"
OR ALWAYS ALLOW POP-UPS FROM THIS WEBSITE!

TURN OFF POP-UP BLOCKER OR TURN ON JAVAsCRIPT
Good to send Viewer a way from your Site!

the best way is not to Target at all
if it not going to a Frame


my Keyword = Hot-Text
But I #1 on Bing and you #3 on Bing
Your Keyword = actbus


my Keyword = Hot-Text
But I #1 on YAHOO and you #3 YAHOO and that was your ACT Bus <<< Gallery >>>
Your Keyword = actbus

You doing OK for a Old Man LOOL
 
T

Trevor Lawrence

To Hot-text
I am offended. How dare you call me an old man!!

I am joking, of course, since I am 68 years and 5 months old. However, I had
many years of experience as a programmer in the Australian Bureau of
Statistics, so I should be able to figure a few things out <vbg>. I actually
forget how many years experience (because I have "old-timers disease" ??)
Well, to tell the truth, it was 25-30 years, depending on how I count it,
either from the first time I started programming, or from the time when it
became my full time work.

On topic,
I have decided not to use target at all, but to use window.open when I want
a new page to open on top of the existing page. It's working quite well.
This means that it will also pass the Strict HTML4.01 validate

BTW,
Our club site is a subsite of ACTBus so most of the hits probably come from
the parent site http://actbus.net/
 
R

Ronx

I would keep the page name, and point to the page opened in the pop-up
window without any messages. This caters for users (and search engines)
that do not have javascript enabled.
--
Ron Symonds
Microsoft MVP (Expression Web)
http://www.rxs-enterprises.org/fp

Reply only to group - emails will be deleted unread.
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top