Created
February 9, 2015 02:33
-
-
Save iamshanto/731c4418e25cda795aaa to your computer and use it in GitHub Desktop.
hinclude alternative
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
// <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