New Version of Editable Plugin

Blog Projects
javascript jeditable jquery
HEADS UP! This article was written in 2007. Information provided might not be valid anymore and should be taken with a grain of salt.

Alert! Alert! Another boring new release is out blog entry ahead. If you are bored already go ahead and download latest (1.5.0 at time of writing) Jeditable source, minified (recommended) or packed. More info and should-be-better documentation at project page.

What is new or changed?

Added placeholder parameter. This can be html on plaintext string. It will be shown when editable element is empty.

Returned JavaScript is now executed. Allows us
to do tricks like returning <script>alert('Saved!')</script> from the save
script.

Hacks which supported old getload and postload parameters are now removed. Use loadurl and loadtype instead.

Callback should now be given in options hash not as third parameter.

Usage of new or changed options below:

 $(".editable").editable("http://www.example.com/save.php", {
     placeholder : "Click me to edit",
     loadurl : "http://www.example.com/load.php",
     loadtype : "POST",
     callback: function(value, settings) {
         console.log(this);
         console.log(value);
         console.log(settings);
     }
 });

Thanks

Thanks to Ole Laursen, Dylan Verheul and Mariano Iglesias for providing patches and ideas!



When asking a question include an URL to example page where the problem occurs. Even better is to make a Fiddle which demonstrates the problem. If you have longer code examples please use pastie.org.
CATEGORIES
Built using the awesome Flat UI Pro framework by Designmodo.

Mika Tuupola is a Member of the Leanpub Affiliate Program.

© 2014 Mika Tuupola.