Velocity Reviews

Velocity Reviews (http://www.velocityreviews.com/forums/index.php)
-   HTML (http://www.velocityreviews.com/forums/f31-html.html)
-   -   converting to STRICT (href values and target attribute) (http://www.velocityreviews.com/forums/t373958-converting-to-strict-href-values-and-target-attribute.html)

petermichaux@gmail.com 10-01-2006 01:11 AM

converting to STRICT (href values and target attribute)
 
Hi,

I am converting an old page to STRICT.

When validating the page I learned that I can't have a link like the
following. The '&' and '=' characters are not allowed? How can I make
this link validate?

<a
href="http://www.foo.com/cgi-bin/test.pl?ACCOUNT=1006458&THE_BUTTON=display_page&PA GE_TYPE=MI_PPC#ASDF">


I also learned that I can't use the "target" attribute in STRICT pages
like the following. What do I do to get around this? Do I have to write
JavaScript in the onclick attribute? That wouldn't be so good if
JavaScript is off.

<a href="http://www.7Search.com/" target="new">7Search.com</a>

Thank you,
Peter


dorayme 10-01-2006 01:43 AM

Re: converting to STRICT (href values and target attribute)
 
In article
<1159665105.259688.133730@m7g2000cwm.googlegroups. com>,
petermichaux@gmail.com wrote:

> Hi,
>
> I am converting an old page to STRICT.
>
> When validating the page I learned that I can't have a link like the
> following. The '&' and '=' characters are not allowed? How can I make
> this link validate?
>
> <a
> href="http://www.foo.com/cgi-bin/test.pl?ACCOUNT=1006458&THE_BUTTON=display_pa
> ge&PAGE_TYPE=MI_PPC#ASDF">
>
>


Best to post the url for this as email and ng postings can pay
tricks on url presentations

> I also learned that I can't use the "target" attribute in STRICT pages
> like the following. What do I do to get around this? Do I have to write
> JavaScript in the onclick attribute? That wouldn't be so good if
> JavaScript is off.
>
> <a href="http://www.7Search.com/" target="new">7Search.com</a>
>


Not heard of "new" as a value here? Don't use strict if you need
target. You using frames?

--
dorayme

petermichaux@gmail.com 10-01-2006 02:11 AM

Re: converting to STRICT (href values and target attribute)
 
dorayme wrote:
> In article
> <1159665105.259688.133730@m7g2000cwm.googlegroups. com>,
> petermichaux@gmail.com wrote:
>
> > I am converting an old page to STRICT.
> >
> > When validating the page I learned that I can't have a link like the
> > following. The '&' and '=' characters are not allowed? How can I make
> > this link validate?
> >
> > <a
> > href="http://www.foo.com/cgi-bin/test.pl?ACCOUNT=1006458&THE_BUTTON=display_pa
> > ge&PAGE_TYPE=MI_PPC#ASDF">

>
> Best to post the url for this as email and ng postings can pay
> tricks on url presentations


I'm not sure what you mean. The URL has a '?' followed by parameters
like this

ACCOUNT=1006458&THE_BUTTON=display_page

http://www.foo.com/cgi-bin/test.pl?A...PE=MI_PPC#ASDF

The ampersands and equals signs are apparently not allowed with the
strict doctype.


> > I also learned that I can't use the "target" attribute in STRICT pages
> > like the following. What do I do to get around this? Do I have to write
> > JavaScript in the onclick attribute? That wouldn't be so good if
> > JavaScript is off.
> >
> > <a href="http://www.7Search.com/" target="new">7Search.com</a>
> >

>
> Not heard of "new" as a value here? Don't use strict if you need
> target. You using frames?


I'm not using frames. The target is for a new window that may already
be open. For example, if I have the following in a page then the first
click opens a new window. More clicks change that same new window.

<p><a href="http://www.google.com" target="foo">google.com</a></p>
<p><a href="http://www.yahoo.com" target="foo">yahoo.com</a></p>

How to convert this kind of behavior to strict doctype?

Thanks,
Peter


dorayme 10-01-2006 02:52 AM

Re: converting to STRICT (href values and target attribute)
 
In article
<1159668686.119524.113510@m7g2000cwm.googlegroups. com>,
petermichaux@gmail.com wrote:

> dorayme wrote:
> >
> > Best to post the url for this as email and ng postings can pay
> > tricks on url presentations

>
> I'm not sure what you mean.


Just that you should try to put up your efforts on a server so we
can see what you are doing, you give us an address of where to
look.

> > >
> > > <a href="http://www.7Search.com/" target="new">7Search.com</a>
> > >

> >
> > Not heard of "new" as a value here? Don't use strict if you need
> > target. You using frames?

>
> I'm not using frames. The target is for a new window that may already
> be open. For example, if I have the following in a page then the first
> click opens a new window. More clicks change that same new window.
>
> <p><a href="http://www.google.com" target="foo">google.com</a></p>
> <p><a href="http://www.yahoo.com" target="foo">yahoo.com</a></p>
>
> How to convert this kind of behavior to strict doctype?


Where did you get the idea to use the word "new"? I may be
missing something.

If you want a link to open in a new window, you can use the
construction <a href="destination.html" target="_blank">

You can use this in docs with

<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01//EN"
"http://www.w3.org/TR/html4/strict.dtd">

They will not validate. This is not the end of the world. You can
still do it. Many browsers will not blink and it will work as you
want.

Your other choice is to use a transitional doc type.

The other thing you can do, and this is generally the best thing
to do: review your wanting to control the windows of website
user. Now that there is tabbed browsing and greater familiarity
with browsers, it is often best to simply leave all this stuff to
the user. This is another reason a URL is desirable. So your
business can be seen completely and we can poke our noses in and
say what is what and how things should or should not be. :-)

--
dorayme

richard 10-01-2006 02:53 AM

Re: converting to STRICT (href values and target attribute)
 

<petermichaux@gmail.com> wrote in message
news:1159665105.259688.133730@m7g2000cwm.googlegro ups.com...
> Hi,
>
> I am converting an old page to STRICT.
>
> When validating the page I learned that I can't have a link like the
> following. The '&' and '=' characters are not allowed? How can I make
> this link validate?
>
> <a
> href="http://www.foo.com/cgi-bin/test.pl?ACCOUNT=1006458&THE_BUTTON=display_page&PA GE_TYPE=MI_PPC#ASDF">
>
>
> I also learned that I can't use the "target" attribute in STRICT pages
> like the following. What do I do to get around this? Do I have to write
> JavaScript in the onclick attribute? That wouldn't be so good if
> JavaScript is off.
>
> <a href="http://www.7Search.com/" target="new">7Search.com</a>
>
> Thank you,
> Peter
>


The validator generally gives you some reasons why the error occurred. Read
up on them.

In general, &amp is best used instead of just &.
"new" should be _blank.
You should take the time to learn what attributes go with which terms.
learn the basics of coding.


Sally Thompson 10-01-2006 08:48 AM

Re: converting to STRICT (href values and target attribute)
 
On Sun, 1 Oct 2006 03:53:38 +0100, richard wrote
(in article <efname020kj@news2.newsguy.com>):

>
> <petermichaux@gmail.com> wrote in message
> news:1159665105.259688.133730@m7g2000cwm.googlegro ups.com...
>> Hi,
>>
>> I am converting an old page to STRICT.
>>
>> When validating the page I learned that I can't have a link like the
>> following. The '&' and '=' characters are not allowed? How can I make
>> this link validate?
>>
>> <a
>> href="http://www.foo.com/cgi-bin/test.pl?ACCOUNT=1006458&THE_BUTTON=display_
>> page&PAGE_TYPE=MI_PPC#ASDF">
>>
>>
>> I also learned that I can't use the "target" attribute in STRICT pages
>> like the following. What do I do to get around this? Do I have to write
>> JavaScript in the onclick attribute? That wouldn't be so good if
>> JavaScript is off.
>>
>> <a href="http://www.7Search.com/" target="new">7Search.com</a>
>>
>> Thank you,
>> Peter
>>

>
> The validator generally gives you some reasons why the error occurred. Read
> up on them.
>
> In general, &amp is best used instead of just &.


You have forgotten the semi-colon: it should be &amp;

To the OP: I like this chart which I find clearer than some:

<http://www.cookwood.com/entities/#punctuation>



--
Sally in Shropshire, UK
bed and breakfast near Ludlow: http://www.stonybrook-ludlow.co.uk
Burne-Jones/William Morris window in Shropshire church:
http://www.whitton-stmarys.org.uk


Joel Shepherd 10-01-2006 04:57 PM

Re: converting to STRICT (href values and target attribute)
 
In article <1159665105.259688.133730@m7g2000cwm.googlegroups. com>,
petermichaux@gmail.com wrote:

> Hi,
>
> I am converting an old page to STRICT.
>
> When validating the page I learned that I can't have a link like the
> following. The '&' and '=' characters are not allowed? How can I make
> this link validate?
>
> <a
> href="http://www.foo.com/cgi-bin/test.pl?ACCOUNT=1006458&THE_BUTTON=display_pa
> ge&PAGE_TYPE=MI_PPC#ASDF">


http://www.example.com/cgi-bin/test....THE_BUTTON=dis
play_page&amp;PAGE_TYPE=MI_PPC#ASDF

.... Should make the validator happier.

Why? Suppose your URL looked like this instead:

http://www.example.com/cgi-bin/test....=2&PAGE_TYPE=M
I_PPC#ASDF

&copy is a defined character entity in HTML. The href value in a link is
CDATA, and browsers are supposed to interpret CDATA:

"CDATA is a sequence of characters from the document character set and
may include character entities. User agents should interpret attribute
values as follows:
* Replace character entities with characters,
* Ignore line feeds,
* Replace each carriage return or tab with a single space."

(http://www.w3.org/TR/html401/types.html#type-cdata)

So your browser would be strongly tempted to replace the &COPY in the
above URL with a copyright symbol character ... and that's probably not
what you want.

Use &amp; instead of & in URLs to separate parameters: browsers will
handle it properly and you'll avoid risk of unintended interpretation.

> I also learned that I can't use the "target" attribute in STRICT pages
> like the following. What do I do to get around this? Do I have to write
> JavaScript in the onclick attribute?


Yes.

> That wouldn't be so good if JavaScript is off.


True, but if the user turned it off, he/she probably knows how to open
pages in new windows/tabs/whatever anyways. If the user isn't human, it
doesn't care.

--
Joel.

usenet+2004@john.dunlop.name 10-01-2006 05:16 PM

Re: converting to STRICT (href values and target attribute)
 
richard:

> In general, &amp is best used instead of just &.


although if a Name character follows, the entity reference must be
closed explicitly, with a semi-colon.

> "new" should be _blank.


They mean different things. With 'new', user-agents SHOULD either load
the resource in a new frame named 'new' or if a frame named 'new'
already exists, load the resource in that frame. The spec talks about
known and unknown frames here. With '_blank', they SHOULD load the
resource in a 'new, unnamed window', regardless of existing frames.
All that assumes that the user-agent understands 'target', that it
doesn't override the attribute, and that there are such things as
frames and windows.

--
Jock



All times are GMT. The time now is 10:50 AM.

Powered by vBulletin®. Copyright ©2000 - 2014, vBulletin Solutions, Inc.
SEO by vBSEO ©2010, Crawlability, Inc.