Created
May 30, 2011 14:54
-
-
Save johanbrook/999011 to your computer and use it in GitHub Desktop.
This file contains 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
// As usual | |
$(document).ready(init); | |
// When the Ajax-event is complete, i.e. when the content is pulled in: | |
$(document).bind("pjax-complete", init); | |
function init(){ | |
// Using Pjax (https://github.com/defunkt/jquery-pjax) | |
// Essentially just a wrapper around the .ajax() function which | |
// adds HTML5 pushState functionality. | |
$("a[href]:not( [data-pjax='false'] )").pjax("[role='main']"); | |
$("selector").someOtherPlugin(); | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment