Created
April 24, 2012 18:18
-
-
Save jehoshua02/2482281 to your computer and use it in GitHub Desktop.
loading partials with JQuery ...
This file contains hidden or 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
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