Here's my jquery function, I'm stuck in a circular callback functions. I'm wondering how do I convert this code to call itself? or is it even possible?
$('#content').load('myurl/items', function() {
...
...
$(this).find('form').submit(function(e) {
e.preventDefault();
$.ajax({
type: 'POST',
url: 'myurl/items',
context: document.getElementByID('content'),
}).done(function() {
$(this).load('/myurl/items', function(){}); // This is recursive
});
}
});