Browse files


  • Loading branch information...
jbeard4 committed Jul 19, 2012
1 parent eaf491a commit 1f362b83fc2fe883b9d7fe1cbc730e339b138604
Showing with 14 additions and 6 deletions.
  1. +14 −6
@@ -223,20 +223,28 @@ Registers a callback to receive notification of state changes, as described abov
Add the following script tags to your web page:
+<script src=""></script>
<script src=""></script>
<script type="text/javascript" src=""></script>
-Note that jQuery is optional. It is used in `scion.urlToModel` and `scion.pathToModel` in order to handle Ajax GET. As an alternative, you can use your own Ajax library to get and parse the SCXML document, and then use `scion.documentToModel(doc)` to create the model object. This would look something like the following:
+Note that SCION assumes the presence of jQuery to handle cross-browser XMLHTTPRequest, however an alternative library could instead be used, in the following way:
- //use some library to get the document via Ajax, parse it, and store in variable doc
- myAjax.get("foo.scxml",function(doc){
- var model = scion.documentToModel(doc);
- },"xml");
+ var platform = require('platform');
+ platform.ajax = {
+ get : function(url,successCallback,dataType){
+ //call your preferred Ajax library here to do HTTP GET
+ //if dataType is 'xml', the Ajax response must be parsed as DOM
+ },
+ post : function(url, data, successCallback, dataType){
+ //call your preferred Ajax library here to do HTTP POST
+ }
+ };
+SCION does not currently use ``, but there are plans to use this API in the future to implement SCXML `<send>`.
# Usage in Node.js
Install SCION via npm:

0 comments on commit 1f362b8

Please sign in to comment.