Transitional validation with "noscript"

S

sevillad

Hi,

I was trying to make my main page compliant (as per w3.org) for HTML
Transitional 4.01, and there's one error I can't solve:

http://validator.w3.org/check?uri=h...ct+automatically)&doctype=Inline&group=0&ss=1
From what I've read around, I think it's related to having "noscript"
inside a "p". And sure enough, if I remove the noscript, the page
validates. I have it in place there because I try to get my email in
the page with Javascript (to avoid some spam) and I want an
alternative for those who may turn it off. Well, actually it's more
out of curiosity that I'd like to find a neat solution :)

Thanks in advance,

David
 
J

John Hosking

sevillad said:
I was trying to make my main page compliant (as per w3.org) for HTML
Transitional 4.01, and there's one error I can't solve:

(why not HTML 4.01 strict?)
http://validator.w3.org/check?uri=h...ct+automatically)&doctype=Inline&group=0&ss=1

inside a "p". And sure enough, if I remove the noscript, the page
validates. I have it in place there because I try to get my email in
the page with Javascript (to avoid some spam) and I want an
alternative for those who may turn it off. Well, actually it's more
out of curiosity that I'd like to find a neat solution :)

It's not the <noscript> per se; it's what's inside it.

Your <p> tag is automatically (deemed to be) closed when the parser
comes to the <div> (which happens to be inside the <noscript> on line
50). The closing </p> tag is optional for <p>, and a <p> can't contain
block-level element (of which <div> is a prime example), so the <p> is
considered closed when the <div> shows up.

Later, after the div is opened and closed, the closing tag </p> shows
up, with no paragraph left open to be closed by it. Validation error.

It looks to me like you can just take the div-ness out of your noscript
block, but you'll have to try it and see. If it works, then you can try
changing your doctype to
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01//EN"
"http://www.w3.org/TR/html4/strict.dtd">
 
A

Adrienne Boswell

Hi,

I was trying to make my main page compliant (as per w3.org) for HTML
Transitional 4.01, and there's one error I can't solve:

http://validator.w3.org/check?uri=http://www.davidsevilla.com% 2F&
charset=%28detect+automatically%29&doctype=Inline&group=0&ss=1

inside a "p".

Yes, because NOSCRIPT is a block level element, and the P element cannot
contain other block level elements.

And sure enough, if I remove the noscript, the page
validates. I have it in place there because I try to get my email in
the page with Javascript (to avoid some spam) and I want an
alternative for those who may turn it off. Well, actually it's more
out of curiosity that I'd like to find a neat solution :)

Change the structure:
<p>
Phone: +43 (0)732 2468 5229<br>
Fax: +43 (0)732 2468 5212<br>
<script type="text/javascript">
emailE='oeaw.ac.at'
emailE=('david.sevilla' + '@' + emailE)
document.write('E-mail:<A href="mailto:'+emailE +'">'+emailE+'<'+'/a>')
</script>
</p>
<noscript>E-mail:<img src="email-ricam.png" height="21" width="167"
alt="My email"></noscript>
 
J

John Hosking

D

dorayme

You have been taking a long time making up your mind. It is true
that some people are agnostic about the existence of God for
their whole lifetimes... Is it going to be like this?
 
J

John Hosking

Neredbojias said:
Well bust mah britches and call me cheeky, on Mon, 03 Sep 2007 19:00:50
GMT John Hosking scribed:

The contents of <noscript></noscript> is html. Not so with <script>
</script>.

Okay, so now it makes sense. That happens sometimes after I actually
think about them. :)
 
N

Neredbojias

Well bust mah britches and call me cheeky, on Tue, 04 Sep 2007 01:17:44 GMT
John Hosking scribed:
Okay, so now it makes sense. That happens sometimes after I actually
think about them. :)

He he, yes, I know what you mean. :)

What I said didn't actually occur to me until I read your message.
 
S

sevillad

Hi,

(why not HTML 4.01 strict?)

I decided some time ago about Transitional, if I remember well it was
because of some code (statcounter.com?) that was giving me trouble and
I didn't want to change. But yes, I'll make it all Strict compliant.

Thanks all for the answers and insight!

David
 

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

Similar Threads


Members online

No members online now.

Forum statistics

Threads
473,995
Messages
2,570,228
Members
46,818
Latest member
SapanaCarpetStudio

Latest Threads

Top