Skip to content

Instantly share code, notes, and snippets.

@iamshanto
Created February 9, 2015 02:33
Show Gist options
  • Save iamshanto/731c4418e25cda795aaa to your computer and use it in GitHub Desktop.
Save iamshanto/731c4418e25cda795aaa to your computer and use it in GitHub Desktop.
hinclude alternative
// <div data-callback="DocumentDashboard.showAlert2()" data-url="/welcome">Loading... Please wait</div>
jQuery('[data-url]').each(function(){
var _that = $(this);
var url = _that.attr('data-url');
var callback = _that.attr('data-callback');
$.get(url, function(html){
_that.html(html);
eval(callback);
}).error(function(){
_that.html('');
});
});
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment