tags:

views:

67

answers:

2

http://wiki.developers.facebook.com/index.php?title=Fb:js-string&redirect=no

in the above link, example coding provided "Real example (PHP): " passing variable to how to work with? convert to code how to use in <'?php XXXXXXXXXXXXXXXXX ?> tag?

A: 

The following would work:

<fb:js-string var="articles.id<?php echo $article['article_id'] ?>">
Do you really want to delete article <?php echo $article['article_id'] ?>?<br /><br />  Associated contributors to this article will remain credited. 
</fb:js-string> 

<a href="#" onclick="removeArticle(<?php echo $article['article_id'] ?>)">Delete Article</a><span id="removeSpan<?php echo $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);
     };
}
</script>

Good luck!

Gdeglin
A: 

whats the use of <'fb:js-string var="articles.id<'?php echo $article['article_id'] ?>">

cant we specify a constant string like var="haihello" and call use as in dialog.showchoice???????????