I have a click handler that reads the href attribute of an a tag and loads the new content via ajax. The function returns false so it doesn’t follow the href url. This works once, but each time thereafter, the function does not appear to get called and the content is not loaded asynchronously, but instead follows the link in the browser.
$ ("document").ready( function () {
$(".post_update").click( function () {
$("#dashboard_content").html(ajax_load).load($(this).attr('href'));
return false;
});
});
<a href="{{ path('post_update', {"id":post.id}) }}" class="post_update">Edit</a>
you should not use document as a string its an object itself try the belwo code.
Since the link is inside dashboard container you should use live in this case.