Welcome to the Question2Answer Q&A. There's also a demo if you just want to try it out.
  • Register
Welcome to the Q&A for Question2Answer.

If you have questions about the platform, click here to ask and please use English.

If you just want to try Q2A, please use the demo, which also grants admin access.

Apr 29: Q2A 1.5.2

doctype for w3c validation of facebook connect code

+1 vote

I'm currently using this doctype:

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

but i have 4 errors on w3c validation regarding facebook connect button

I tried to change the doctype to: 

<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML+RDFa 1.0//EN" "http://www.w3.org/MarkUp/DTD/xhtml-rdfa-1.dtd">

but this generates more errors.

What doctype should i use to validate my html?

http://validator.w3.org/check?uri=http://kermit.ro

asked May 13, 2011 in Q2A Core by anonymous

1 Answer

0 votes

Yes, the errors you get when you switch to XHTML are caused by Q2A's HTML tags being generated in upper-case, which is not acceptable XHTML.

The first two errors you are getting now could be solved by putting the required type="text/javascript" attributes on the two <script> tags introduced by the Facebook login plugin. You can change this inside the plugin PHP.
 
The next two are trickier. If you try to tell the validator about the FB namespace you will get another error. The best solution might be to get rid of this (again in the plugin):
<fb:login-button perms="email,user_about_me,user_location,user_website"></fb:login-button>
and replace it with this:
 
<script type="text/javascript">document.write('&lt;fb:login-button perms="email,user_about_me,user_location,user_website"&gt;&lt;/fb:login-button&gt;');
</script>
 
Since the FB connect code needs javascript to run, you're not losing anything by doing this.
 
Alternatively, if you are using jQuery with your theme (or in future using Q2A 1.4, which provides jQuery), you might find this sort of solution appropriate:
 

 

answered May 25, 2011 by dofmike
edited May 25, 2011 by dofmike