Skip to content

Instantly share code, notes, and snippets.

@jehoshua02
Created April 24, 2012 18:18
Show Gist options
  • Save jehoshua02/2482281 to your computer and use it in GitHub Desktop.
Save jehoshua02/2482281 to your computer and use it in GitHub Desktop.
loading partials with JQuery ...
function load_partial(element) {
if (element == undefined) {
$('.partial').each(function () {
load_partial(this);
});
return;
}
else
{
var action = element.id.replace('_', '/');
var url = base_url + action;
$(element).load(url, null, function () {
$('.partial', this).each(function () {
load_partial(this);
});
});
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment