Browse files

Updated README to support AMD.

  • Loading branch information...
1 parent 5d0754c commit 3b4227fe9f5054ef287cce2c455b63e85fae7547 @jbeard4 committed Apr 1, 2013
Showing with 13 additions and 5 deletions.
  1. +13 −5
@@ -121,8 +121,6 @@ There are then **4 steps** that must be performed to go from an SCXML document t
<script src=""></script>
<script type="text/javascript" src=""></script>
- var scion = require('scion');
var rect = document.getElementById("rect");
@@ -223,20 +221,30 @@ Furthermore, for the `onTransition` callback, argument `targetStateIds` will be
# Usage in Browser
-Add the following script tags to your web page:
+Add the following script tags to your web page, which will make SCION available as a global variable `scion`:
<script src=""></script>
<script src=""></script>
<script type="text/javascript" src=""></script>
+SCION is also available as an AMD module, so if you are using RequireJS in your page, then you can do the following:
+<script src=""></script>
+<script src=" "></script>
+ //use SCION here
Note that SCION assumes the presence of jQuery to handle cross-browser XMLHTTPRequest, however an alternative Ajax library could instead be used. This is set up in the following way:
//perform this setup once, before SCION is used
- var platform = require('platform');
- platform.ajax = {
+ scion.platformModule.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

0 comments on commit 3b4227f

Please sign in to comment.