How it works
A small piece of javascript reads al SPAN tags, checks if it has class=“editText” and a id=. If that is true, it adds a onclick function. That onclick function will create a textfield or input (depending on the size of the editable text). Someone has the ability to edit the field. When the text field is blurred, it will read the contents, and starts a XMLHttpRequest and ‘sends’ the content + fieldname + any set vars to an update file. That file will update your database, and reply with the newly set text and the textfield will dissapear again.
Compatibility
This script works in Internet Explorer, Firefox, Chrome, Opera and Safari.
Download: http://www.yvoschaap.com/instantedit/instantedit.js
Source: http://www.yvoschaap.com/index.php/weblog/ajax_inline_instant_update_text_20/

Related Listings:
No comments yet.
RSS feed for comments on this post. TrackBack URL