Mock AJAX

Mock AJAX is a tool that, through simple attributes added to elements of HTML and FBML, allows dynamic loading of data via AJAX directly from your own servers. If you add a few attributes to a simple submit button, upon a click of that submit button, the specified element will refresh with the specified content from your servers. Here are the attributes available:

clickrewriteid

The ID of the element on the page to be refreshed.

clickrewriteurl

The URL on your servers (this cannot be a Facebook URL!) that returns data to be refreshed into the specified element.

clickrewriteform

The form that will be submitted upon a click of the button containing these attributes.

Mock AJAX works on anything that can be clicked, but it must submit a form on the page when clicked. Here’s some example code using Mock AJAX:

<form id="ajax_form">
  <input type="text" name="test"/>
</form>
<a href="#" clickrewriteid="data" clickrewriteurl=
    "http://fbmlessentials.staynalive.com/mockajax.php"
  clickrewriteform="ajax_form">Click here to load the data</a>
<div id="data"></div>

To test the return data, inspect the term FBML.mockAjaxResponse using a development tool such as Firefox’s Firebug. The data within should give you clues as to what is going on. I strongly recommend using Firebug to debug your Mock AJAX calls.

..................Content has been hidden....................

You can't read the all page of ebook, please click here login for view all page.
Reset
3.141.37.10