Help - Search - Members - Calendar
Full Version: Validation errors - no attribute DATA-COUNT,DATA-VIA
HTMLHelp Forums > Web Authoring > Markup (HTML, XHTML, XML)
Beth
Hi,

I am trying to validate my pages, but I am getting the following errors on which are for my twitter button. I am using HTML 4.01 Transitional. I have found that this version does not support these attributes, but is there any way to work around this so that I can have the button on my page? I saw that you can use an iframe, but that had it's own error and I would prefer not to use it.

•Line 16, character 12:
data-count="none" data-via="CozyCactusGifts">Tweet</a>
^Error: there is no attribute DATA-COUNT for this element (in this HTML version)

•Line 16, character 28:
data-count="none" data-via="CozyCactusGifts">Tweet</a>
^Error: there is no attribute DATA-VIA for this element (in this HTML version)


The page is: wedding gifts

CODE
<a href="http://twitter.com/share" class="twitter-share-button"
data-count="none" data-via="CozyCactusGifts">Tweet</a>
<script type="text/javascript" src="http://platform.twitter.com/widgets.js"></script></li>


Thanks for your help!
pandy
Well, there is no such attribute. They have invented it for their own use. It won't harm anything to leave it as it is.
Beth
Bummer! I like to keep my pages nice and validated -- makes me feel like I'm getting an A++ or something! Oh well smile.gif

Thanks for the info!
pandy
It's surprising that Twitter does that. It must annoy many people. I didn't know.

What you could do, even if it's just paying lip service, is to let JavaScript write out the Twitter link so the validator doesn't see it. A little silly, me thinks, but it was a popular way to "hide" junk code while ago.
Beth
I did find that a lot of people had the same problem, but couldn't find any answers.

QUOTE
let JavaScript write out the Twitter link so the validator doesn't see it


How do I do that?
This is a "lo-fi" version of our main content. To view the full version with more information, formatting and images, please click here.
Invision Power Board © 2001-2013 Invision Power Services, Inc.