pushie
** CommonJS/Browserified ajax form submission **
Pushie is a browser history api wrapper, with fallback support to use URL hashes.
Example
Check out example/index.html
, the example javascript for the example page is resources/js/example_src.js
Installation
$ npm install pushie
Pushie is a browserified/commonjs javascript module.
Usage
JavaScript
var Pushie = myPushie uiButton; //initialize nav component after the dom has loadedwindow;
HTML
Your Page replace third history
OPTIONS
defaultOptions = push_state_support: true { console; } { console; } { console; };
API
//submit pushie via ajaxmyPushie; // options.data, options.title, options.hrefmyPushie; // options.data, options.title, options.hrefmyPushie; // if no window.history.pushState then supply options.href //eventsmyPushie; // callback()myPushie; // callback(data)myPushie; // callback(data)myPushie; // callback(data)
Development
Make sure you have grunt installed
$ npm install -g grunt-cli
Then run grunt watch
$ grunt watch #uses grunt-connect on port 8181
For generating documentation
$ grunt doc
$ jsdoc2md lib/**/*.js index.js > doc/api.md
Notes
- The Pushie uses Node's event Emitter for event handling.
- In order to test post submission, grunt connect is used on port 8181