Data update in place with jQuery only configuration html5 data attribute.
Include script after the jQuery library:
<script src="/path/to/jquery-data-ajax-place-update.js"></script>
Configure attributes in the link tag:
<a data-ajax='{"update": "#mysrc", "place": "#content"}' href="/test/">Test</a>
<div id="mysrc"></div>
- update: HTML element to be inserted content.
- place: Piece you want to capture of the link.
var $resources = {
'load_image': '<img class="loader" src="/path/to/img/loader.gif" alt="Loading...">',
'urlerror': '/error/',
'url404': '/error-404/',
'url500': '/error-500/'
}
A basic django project myajax with the jQuery script integrated.
Enjoy!