Welcome to Questionaries, where you can ask questions and receive answers from other members of the community.

Let us know at info@questionaries.org

How can I use jQuery to dynamically load serverfbml content into my IFRAME app page?

11 like 0 dislike
Hi friends,

I need to render a friend selector or request form and I need the content to be dynamically generated and I would like to do it using jQuery  but whenever I try to load <fb:serverfbml>  using jQuery it breaks. Can I make this work?
asked 1 year ago by biswaskeran (70,430 points)

1 Answer

2 like 0 dislike
Hello,

          Alternatively it's jQuery's html parser that messes things up. So if you set the innerhtml manually it'll work fine.

Sou can load it all in using:

$.ajax({
  type:"GET",
  url: "/my/url",
  datatype: 'text',
  success: function(html) {
    var ele = $('myselector')[0];
    ele.innerHTML = html;
    FB.XFBML.Host.parseDomElement(ele);
  }
});

The only issue with this is that none of the javascript included in the html will be run upon insertion.
answered 1 year ago by tulip (12,960 points)

Related questions

9 like 0 dislike
1 answer
6 like 0 dislike
0 answers
8 like 0 dislike
1 answer
4 like 0 dislike
1 answer
asked 1 year ago by Edward (33,730 points)
2 like 0 dislike
1 answer