Skip to content

Instantly share code, notes, and snippets.

@postpostscript
Last active June 14, 2016 19:51
Show Gist options
  • Save postpostscript/3cb2479aa5fc819dac4b3b0af53528b3 to your computer and use it in GitHub Desktop.
Save postpostscript/3cb2479aa5fc819dac4b3b0af53528b3 to your computer and use it in GitHub Desktop.
ajax-load html attribute
$(function() {
$('[ajax-load]').each(function() {
var $this = $(this);
$this.load($this.attr('ajax-load'), function() {
if ($this.attr('ajax-onloaded')) {
eval($this.attr('ajax-onloaded'));
}
});
});
});
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment