For the most part, most commonly used HTML tags will work on the Facebook platform. If you’ve worked with HTML in the past, you’re already familiar with this part of the platform. One major difference between typical HTML and FBML is that “normal” JavaScript is stripped from your code. For instance, you cannot use the onclick attribute in the anchor (<a>) tag to call JavaScript:
<p>
<a href="javascript:alert('You\'ll never see me');">click me</a>
</p>
Although completely valid HTML and JavaScript, the previous will raise an error when your users look at the page containing this code.
Don’t worry, if you need access to JavaScript for your application, Facebook has developed FBJS, which will allow you to use many of the conventions you typically see in JavaScript.
When working with FBML, remember that it’s not exactly HTML, even though you use a lot of the same syntax. Your code has to be processed through the Facebook platform to ultimately generate the HTML that gets rendered to the user, so not everything you’re used to doing with HTML code will work.
Although completely valid HTML and JavaScript, the previous will raise an error when your users look at the page containing this code.
Don’t worry, if you need access to JavaScript for your application, Facebook has developed FBJS, which will allow you to use many of the conventions you typically see in JavaScript.
When working with FBML, remember that it’s not exactly HTML, even though you use a lot of the same syntax. Your code has to be processed through the Facebook platform to ultimately generate the HTML that gets rendered to the user, so not everything you’re used to doing with HTML code will work.
0 comments
Post a Comment