views:

521

answers:

2

Hi,

This may sound very noobish but I have tried to read the forum posts and docs on javascript behavior on Facebook's profile tabs. I understand that profile tabs don't support referencing external javascript but even my inline tags are not showing up on profile pages.

In fact I am trying the fbjs-swf bridge and the code needed to instantiate the swf does not show up on the page

<fb:fbjs_bridge/>

<div id="swfContainer"></div>
<script>
   var swf = document.createElement('fb:swf');
   swf.setId('my_swf_id');
   swf.setWidth('630');
   swf.setHeight('520');
   swf.setSWFSrc('http://www.muziboo.com/swf/player4-2.swf'); 
   document.getElementById('swfContainer').appendChild(swf);
   document.getElementById('my_swf_id').callSWF('asMethod', 'one', 'two');
</script>

I see a swf embedded (the one for the fbjs bridge) but I don't see any script tag containing the above javascript code. What am I missing? I can see the javascript code on canvas page though

Thanks

+1  A: 

Turns out that Facebook does not execute the javascript on profile pages until the first click by the user. Also you don't see your javascript exactly but using Firebug and Flashbug (for swf debugging), you can see the errors

prateekdayal
A: 

Here is a hack that has been working for me (put this above your fb:swf)

<script>
function activate () {}
</script>

<div id="swfCont" onmousedown="activate()">
<fb:swf...

related questions