Reference Guide
facebook FBML Reference Guide Page 71 of 159
Misc
Fb:js-string
Description
This tag renders a block of FBML into an FBML block variable instead of rendering it on the page. You can use
this variable in your JavaScript with setInnerFBML. See FBJS for more information.
Attributes
Required Name Type Description
required var
string
A valid JavaScript identifier.
Examples
<fb:js-string var="example">Pre-rendered FBML content.</fb:js-string>
a screenshot is not applicable for this tag
<fb:js-string var="name.element1">This is the first element.</fb:js-string>
<fb:js-string var="name.element2">This is the second element.</fb:js-string>
This allows you to access name as if it were a JavaScript array.
The array can only be one level deep, and associative names must be prefixed by at least 1 alphabetical
character (name.5, name.6, etc. will not work).
Real example (PHP):
<fb:js-string var="articles.id{$article['article_id']}">
Do you really want to delete article #{$article['article_id']}?<br /><br />
Associated contributors to this article will remain credited.
</fb:js-string>
<a href="#" onclick="removeArticle({$article['article_id']})">Delete Article</a><span
id="removeSpan{$article['article_id']}"></span>
<script>
function removeArticle(articleId) {
var dialog = new Dialog(Dialog.DIALOG_CONTEXTUAL);
dialog.setContext(document.getElementById("removeSpan"+articleId));
dialog.showChoice('Confirm Removal', articles["id"+articleId], 'Yes', 'Cancel');
dialog.onconfirm = function() {
document.setLocation('http://apps.facebook.com/facebookdocs/removearticle.php?article='+articleId);
};
}
www.yapish.com










