Categories
josephscott

AJAX Edit In Place With Prototype (Javascript), Version 0.3.1

Here’s what has changed since 0.3.0:

  • Removed some unnecessary variable checks
  • Add a new option, escape_function.

I looked at adding support for password fields, but it doesn’t seem to make much sense for editing text in place.

The new escape_function option defaults to escape (which is what all previous version of EditInPlace also used), but also supports encodeURIComponent. Adding support for encodeURIComponent was suggested by Peter, because it has better language support. If you do use encodeURIComponent keep in mind that it will add slashes for characters that escape doesn’t. For PHP users that means you need to use stripslashes() on $_POST[“content”] when using encodeURIComponent.

You can download eip-0.3.1.tar.gz and check out the example page to see it action.

One reply on “AJAX Edit In Place With Prototype (Javascript), Version 0.3.1”

There seems to be a bug when the text contains quotation marks. For example, if I change the text in the example.html from:

You can edit this line with a single click.

to:

You can “edit” this line with a single click.

Then when you click on the line, the text in the textarea is “You can “. Everything after the first quotation mark is dropped.

Leave a Reply

Your email address will not be published. Required fields are marked *