-
-
Save maccman/938403 to your computer and use it in GitHub Desktop.
troubleshooting spine.js
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<!DOCTYPE html> | |
<html> | |
<head> | |
<script src="jquery.js" type="text/javascript" charset="utf-8"></script> | |
<script src="../spine.js" type="text/javascript" charset="utf-8"></script> | |
<script src="../lib/spine.route.js" type="text/javascript" charset="utf-8"></script> | |
<script type="text/javascript" charset="utf-8"> | |
jQuery(function(){ | |
var App = Spine.Controller.create({ | |
el: $("body") | |
,elements: { | |
"#home": "$home" | |
,"#step-1": "$step1" | |
,"#step-2": "$step2" | |
,"#step-3": "$step3" | |
} | |
,events: { | |
"click .nextStep": "nextStep" | |
} | |
,init: function(){ | |
this.routes({ | |
"/step/:num": function(num){ | |
console.log("step", num) | |
} | |
,"/home": function(){ | |
console.log("home") | |
} | |
}); | |
console.log("App init"); | |
this.navigate("/other"); | |
} | |
}); | |
// sets up initial routing | |
Spine.Route.setup(); | |
App.init(); | |
}); | |
</script> | |
</head> | |
<body> | |
<a href="#/step/1">/step/1</a> | |
<a href="#/home">/home</a> | |
</body> | |
</html> |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment