Skip to content
nyarly edited this page Sep 6, 2011 · 2 revisions

In an HTML page, you’ll start with:

<scriptsrc="js/jquery-1.6.js"></script><scriptsrc="js/ns.min.js"></script>

and then either:

<script>
<!-- Ninjascript stuff here -->
</script>

or

<scriptsrc='js/behaviors.js'></script><!-- behaviors is where the Ninjascript stuff goes -->

Pretty much like you’d expect. Note that at the moment, Ninjascript requires jquery (1.4+) to already be loaded. We’re examining that requirement, but it’s pretty much unreasonable to package a whole extra copy of jQuery, when most people will be using it anyway.

The “Ninjascript stuff” you can do in a host document looks like this:

<script>Ninja.orders(function(Ninja){Ninja.behavior({".coolthing": submitsAsAjax()})Ninja.go()})</script>

Clone this wiki locally