Skip to content

Instantly share code, notes, and snippets.

@snichme
Created January 31, 2013 13:44
Show Gist options
  • Save snichme/4682964 to your computer and use it in GitHub Desktop.
Save snichme/4682964 to your computer and use it in GitHub Desktop.
Head.js example
<script>
head.ready(function() {
// Use your javascript here...
// Load a new js file:
head.js("path/to/file.js", function() {
// here the new script is available
});
// Or use jQuery
$("a.ajax").click(function(){
var o = $(this),
url = o.attr("href");
url = url.substr(0, url.lastIndexOf("#"));
console.log(this.hash, url);
$(this.hash).load(url);
return false;
});
});
</script>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment