- Tester SNML
- Browser API
- Tester della firma
- Documenti SNML
- Documenti API
- Documenti SNQL
- Documenti SNJS
SNJS Ajax
SNJS-Ajax provides an object, which makes it easy for developrs to use AJAX with SNJS. All SNJS-AJAX requests are proxied by Bebo and the response is processed if the responseType is set to JSON or FBML. To use SNJS-Ajax, just instantiate a new Ajax object.The following properties are supported:
- ondone(data)
- An event handler which fires when an AJAX call returns. Depending on the responseType, data is an object, a raw string, or an SNML string.
- onerror
- An event handler that fires when an error occurs during an AJAX call.
- responseType
- This can be one of Ajax.RAW, Ajax.JSON, or Ajax.FBML.
- Ajax.RAW
- The response from your server is returned to your callback in its original form.
- Ajax.JSON
- The response from your server is parsed and returned to your callback in the form of an JSON object. Properties of your JSON object that are prefixed with "snml_" are treated as SNML strings and are parsed and returned as SNML blocks.
- Ajax.FBML
- The response from your server is parsed as SNML and returned as an SNML block. This block can used on a DOM object with the setInnerFBML method.
And two methods:
- post(url, query)
- Start an AJAX post. url must be a remote address, and query can be either a string or an object that is automatically converted to a string. The query parameters can also be sent along with the url.
- abort()
- Aborts an AJAX post.