facebook - Can javascript be used in static FBML under pages' tab? -


I want to hover the image in the static FBML page.

But the following simple code also works:

  & lt; Div id = "button1" & gt; Button1 & lt; / Div & gt; & Lt; Set id = "button2" onmouseover = "document.getElementById ('button1'). Set-style ({display: 'none}}" & gt; button2 & lt; / div & gt; & lt; script type = " Text / JavaScript "& gt; Document.getElementById ('button1'). SetStyle ({Display: 'None'});   
  & lt; div Id = "button1" & gt; button1 & lt; / div & gt;  

When "onmouseover" is turned into "onclick", this works. & Lt; div Id = "button2" onclick = "document.getElementById" ('button1'). Set-style ({display: 'none'}} "button2

gt; & lt; script type =" text / Javascript "& Gt; Document.getElementById ('button1'). SetStyle ({display: 'none'});

Is there a mess? < / P>

Javascript is not allowed Facebook FBML application (they may be allowed in IFrame applications but nothing is certain ) For alternative, see Facebook JS.

EDIT: In this case, this will not work because the javascript placed in the profile box has not run until the first user event. From FBJS Wiki:

"In the profile box, inline scripts are postponed unless the" active "event is triggered by the user. An active event is called onfox, onclick, omanodown, And in the same way, anything that requires a mouse click is an "active" phenomenon, on the canvas page, however, this example works fine. "


Comments

Popular posts from this blog

c# - How to capture HTTP packet with SharpPcap -

jquery - SimpleModal Confirm fails to submit form -

php - Multiple Select with Explode: only returns the word "Array" -