Skip to content

Data update in place with jQuery only configuration html5 data attribute.

Notifications You must be signed in to change notification settings

macndesign/jquery-data-ajax-place-update

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

22 Commits
 
 
 
 
 
 
 
 
 
 

Repository files navigation

jquery-data-ajax-place-update

Data update in place with jQuery only configuration html5 data attribute.

Installation

Include script after the jQuery library:

<script src="/path/to/jquery-data-ajax-place-update.js"></script>

Usage

Configure attributes in the link tag:

<a data-ajax='{"update": "#mysrc", "place": "#content"}' href="/test/">Test</a>
<div id="mysrc"></div>

Attributes legend:

  • update: HTML element to be inserted content.
  • place: Piece you want to capture of the link.

Define the resources in HTML page, inside of a script tag:

var $resources = {
    'load_image': '<img class="loader" src="/path/to/img/loader.gif" alt="Loading...">',
    'urlerror': '/error/',
    'url404': '/error-404/',
    'url500': '/error-500/'
}

Authors

Extra

A basic django project myajax with the jQuery script integrated.

Enjoy!

About

Data update in place with jQuery only configuration html5 data attribute.

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published