Fb:js-string
Wednesday, December 19th, 2007Encore une petite spécialité de facebook.
Lorsque que vous utilisez du FBJS, il vous arrive de vouloir réécrire le contenu d’un élément (div ou autre), ça à bien sur été mon cas.
Alors forcément j’attaque simplement par faire :
document.getElementById(”elementX”).setInnerFBML(”<a href=’#’ onclick=”search(’www.google.com?&”+hello+”‘)>Search hello</a>”);
Où, hello est une variable java-script par exemple.
Mais bien sur ça ne marchait pas ;-), je suis tombé sur un des nombreux cas ou le setInnerFBML n’accepte pas le code que vous lui passez.
La solution est donc d’utiliser notre balise Fb:js-string comme suit :
Je rend la balise dans la vue, (je fais du rails)
<fb:js-string var=”searchLink”>
<a href=’#’
onclick=”search(’www.google.com?&<%= hello %>’)Search hello
</a>
</fb:js-string>
On réecrit finalement le JS comme suit:
document.getElementById(”elementX”).setInnerFBML(searchLink);
Tout simple.. mais non moins bizarre.
PS: un peu de pitié ce n’est qu’un de mes premiers essais de billet techniques et je manque encore cruellement de connaissances et d’expériences.
Hypotheek informatie, hypotheek aanvragen of afsluiten? Hypotheekrentes bekijken. Hypotheek aanbieders vergelijken, hypotheek vormen, bijkomende kosten,
Lenen Zonder BKR Toetsing Lenen zonder BKR toetsing stijgt in populariteit op het Internet. Veel mensen met een zogeheten BKR notatie, die toch geld willen lenen zijn op zoek naar …
Migraine is een ernstige vorm van hoofdpijn. Het treedt in aanvallen op en gaat vaak gepaard met visuele stoornissen en misselijkheid.
Migraine is hoofdpijn die in aanvallen komt. De hoofdpijn komt plotseling op, soms midden in de nacht zodat u er wakker van wordt. De pijn zit meestal aan
yyvcifmvyse best rated online casinos tpuvsmh
tksadnhtndpqdxce online casino promotions okcwfqy
aghzgrnvyzmiyvoclgkg phentermine 37.5 ldqxxkggeod
Christ CHRIST IS Great
i dont trust most of you, you morons..
.each and every issue youre conversing of is weapon cost ranges..
..use your human brain quit appearing like youngsters. its truly miserable so see how idiotic so numerous adult males and ladies are..
.
Just killing some in between class time on Stumbleupon and I found your entry. Not normally what I like to learn about, but it was certainly worth my time. Thanks.
@chels I know what you mean, its hard to find good help these days. People now days just don’t have the work ethic they used to have. I mean consider whoever wrote this post, they must have been working hard to write that good and it took a good bit of their time I am sure. I work with people who couldn’t write like this if they tried, and getting them to try is hard enough as it is.