Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations gkittelson on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

This code won't validate. Any idea why? 1

Status
Not open for further replies.

hotfusion

Technical User
Jan 20, 2001
755
GB
Bear with me, I'm trying to learn HTML and have written some pages partly by way of practice, and the following bit of code is an extract from this page:
(No remarks are necessary regarding the content, thanks!)
Here is the troublesome code:

<p style="text-indent:0cm;">
<script language="javascript" type="text/javascript" src="homecounter.js"></SCRIPT>
<noscript><em>With JavaScript enabled, a hit counter will appear here.</em></noscript>
</p>

Now, using W3Cs validation service, it reports an error in that the final </p> tag is not required, as the element is already closed. I've looked at this 'till hy head hurts, but can't see an error as such. This same error is repeated elsewhere, and seems related to the <noscript> element.
Any ideas??


Regards, Andy.
**************************************
My pathetic attempts at learning HTML can be laughed at here:
 
Try this:

[tt]
<script language="javascript" type="text/javascript" src="homecounter.js"></SCRIPT>

<noscript>
<p style="text-indent:0cm;">
<em>With JavaScript enabled, a hit counter will appear here.</em>
</p>
</noscript>
[/tt]

*cLFlaVA
----------------------------
Ham and Eggs walks into a bar and asks, "Can I have a beer please?"
The bartender replies, "I'm sorry, we don't serve breakfast.
 
Thanks for the rapid response, cLFlaVA, I'll try your suggestion now. Is this because perhaps having the <noscript> element inside the <p> element is illegal?


Regards, Andy.
**************************************
My pathetic attempts at learning HTML can be laughed at here:
 
A follow up to my query:
cLFlaVA, I've implemented your suggestion and the pages concerned now validate fine, and display as I require.
Thanks again for your fast, accurate response.

Regards, Andy.
**************************************
My pathetic attempts at learning HTML can be laughed at here:
 
Foamcow, you are correct, although as I understand it, it doesn't matter at the moment and wasn't the cause of the problem in this case. I always write my HTML in lower case as a matter of habit, but this bit managed to somehow escape as it was originally copy/pasted direct from the hit counter site, but has since been 'corrected'.
But thanks anyway for your observations.

Regards, Andy.
**************************************
My pathetic attempts at learning HTML can be laughed at here:
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top