facebook doctype, is it being deprecated?

Jae Lee picture Jae Lee · Mar 2, 2011 · Viewed 7.5k times · Source

I've recently started working on a facebook app and I am lost and confused trying to get any direct answer. Googling for answers don't seem to work too well with facebook as things are changing too fast and blogs rarely update it to reflect the new APIs.

I know Facebook will deprecate FBML and I am overjoyed by that. So my question is, will the DOCTYPE facebook gave you to put on your site, being deprecated?

What does doing this even do?

Answer

Idris Mokhtarzada picture Idris Mokhtarzada · Mar 2, 2011

Assuming you are talking about this:

<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd">
<html xmlns="http://www.w3.org/1999/xhtml" xmlns:fb="http://www.facebook.com/2008/fbml">

(specifically the xmlns:fb="http://www.facebook.com/2008/fbml"). They are not deprecating that. You should continue to add xmlns:fb="http://www.facebook.com/2008/fbml" in your <html> tag. However, for modernity you should be using the HTML5 doctype, so your doctype and HTML tag should look like this:

<!DOCTYPE html>
<html xmlns="http://www.w3.org/1999/xhtml" xmlns:fb="http://www.facebook.com/2008/fbml">

What the xmlns:fb part does is specifies the XML namespace for tags within the page which begin with the fb: prefix (such as <fb:name/>).