Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

HTML: What is `xmlns:fb="http://www.facebook.com/2008/fbml"`?

What is xmlns:fb="http://www.facebook.com/2008/fbml"?

I've been seeing it in a lot of <html> tags recently. What does it do?

like image 264
Rudiger Avatar asked Jan 10 '11 21:01

Rudiger


People also ask

What is xmlns FB?

This tells your browser where to find the specification for FBML which in turn tells it how to handle the <fb:*> tags. Technically speaking, the value of the xmlns:* attribute is simply a unique identifier, but often it is a URL which points to a definition in one form or another.

What is xmlns in HTML?

The xmlns attribute specifies the xml namespace for a document. Note: The xmlns attribute is required in XHTML, invalid in HTML 4.01, and optional in HTML5.

Why do we need xmlns?

An XML namespace is a collection of names that can be used as element or attribute names in an XML document. The namespace qualifies element names uniquely on the Web in order to avoid conflicts between elements with the same name.


2 Answers

While I haven't seen it in use, this is standard XML notation for extending the current XML namespace (in this case XHTML) with another one (in this case FBML). This tells your browser where to find the specification for FBML which in turn tells it how to handle the <fb:*> tags. Technically speaking, the value of the xmlns:* attribute is simply a unique identifier, but often it is a URL which points to a definition in one form or another. In this particular case the URL doesn't point to a definition unfortunately.

See W3Schools for more information about XML namespaces.

like image 118
Matthew Scharley Avatar answered Sep 25 '22 09:09

Matthew Scharley


Just as @Matthew Scharley said, its used to embed Facebook-specific tags on your site. For example, here's our company's Facebook stream on our site. Another common use it the "Like" button on website. More information can be found on the Facebook developer site.

UPDATE

Here's some additional widgets/plugins.

like image 21
Chris Haas Avatar answered Sep 22 '22 09:09

Chris Haas