I use Twitter Widget in my application [asp.net c#].
My code is:
StringBuilder strTwittsViewer = new StringBuilder();
strTwittsViewer.Append("</span><span class='cssClassFollowButton'><a href=\"https://twitter.com/Shree\" class=\"twitter-follow-button\" data-show-count=\"false\">Follow @Shree</a>");
strTwittsViewer.Append("<script type='text/javascript'>!function(d,s,id){var js,fjs=d.getElementsByTagName(s)[0];if(!d.getElementById(id)){js=d.createElement(s);js.id=id;js.src=\"//platform.twitter.com/widgets.js\";fjs.parentNode.insertBefore(js,fjs);}}(document,\"script\",\"twitter-wjs\");</script></span></p>");
but my code unable to pass W3C validation.I got a error
there is no attribute "data-show-count"
…witter-follow-button" data-show-count="false">Follow @shree</a><script typ…
I search and find this solution but unable to understand how to implement this solution with my code.Thanks.
Because data attributes are part of the HTML 5 spec. Use
<!DOCTYPE html>to specify the HTML 5 doctypeTaken from here
OR
Put your link code into document.write so you’ll have