Fb:user-agent

From Facebook Developer Wiki

Revision as of 01:19, 6 January 2009 by Andy Savage (Talk | contribs)
(diff) ←Older revision | Current revision (diff) | Newer revision→ (diff)
Jump to: navigation, search

Contents

Description

Displays the contents wrapped inside the tag to the specified user-agents. You can use fb:user-agent on the canvas page and the profile box. It serves as a tool to deal with browser idiosyncrasies.

User-Agent Resources

Attributes

RequiredNameTypeDescription
required includes string A comma-delimited list of strings to test for inclusion against the HTTP request's user-agent string. If a given include string matches the user-agent string, the content inside the include tag appears; otherwise it does not.
optional excludes string A comma-delimited list of strings to test for exclusion against the HTTP request's user-agent string. If a given include string matches the user-agent string, the content inside the include tag does not appear; otherwise it does appear.

Examples

<fb:user-agent includes="ie 6,ie 7"> Hi IE 6/7 users. </fb:user-agent>


<fb:user-agent excludes="firefox"> Hi people not using Firefox. </fb:user-agent>


<fb:user-agent includes="mozilla" excludes="firefox/2.0"> Hi Mozilla (but not Firefox 2.0) users. </fb:user-agent>


<fb:user-agent includes="ie" excludes="ie 6"> Hi IE (but not IE 6) users. </fb:user-agent>

Notes

If both the includes and excludes attributes exist, the order of operation is to evaluate the includes then the excludes. For example, you can state includes="MSIE" excludes "MSIE 6.0". The matching is case-insensitive.

Should be used around style tags not within them.

reference