Skip to content

Latest commit

 

History

History
44 lines (35 loc) · 653 Bytes

README.md

File metadata and controls

44 lines (35 loc) · 653 Bytes

jedit

Asynchronous jQuery in-place edit plugin

$('.editable').jedit('http://example.com/save.php');

Sync

$('.editable').jedit(function(value) {
  return value;
});

Custom AJAX call

$('.editable').jedit(function(value) {
  return $.post('http://example.com/save.php', { value: value });
});

Custom promise

$('.editable').jedit(function(value) {
  var d = $.Deferred();
  setTimeout(function() {
    d.resolve(value);
  }, 2000);
  return d.promise();
});

Callback styled

$('.editable').jedit(function(value, done) {
  setTimeout(function() {
    done(null, value);
  }, 2000);
});