Posts in "AJAX" category

Google Web Toolkit

Just a short note, i found this today – Google Web Toolkit. It looks very promising and I’m just about to start experimenting with it (can’t wait!). It’s a framework for creating AJAX applications with the usual gmail look, but the fresh approach is that you write the application in Java – and then you compile to to Javascript/HTML when you’re ready to ship.

I’m don’t how well this development model works with dynamic data etc. but I’m sure they have a clever way to do that too. Will report more later when I’ve tested it :)

How to get the AJAX In Place Editor to use ISO-8859-1

When implementing’ AJAX In Place Editor for a project I’m currently working on, I ran into some character encoding problems. My PHP framework uses ISO-8859-1, while the ajax script was submitting UTF-8 to my server. Reading the wiki documentation, I discovered that this was a ‘known feature’:

The form data is sent encoded in UTF-8 regardless of the page encoding.

I was recommended to use iconv to convert back to ISO-8859-1 on the server. Unfortunately this was not an option for me, as it wasn’t available on the production server. Of course, there is PHP’s utf8_decode(), but anyone who has used it will tell you it is totally unreliable.

So, here’s how to get it to use the encoding of your page (e.g. ISO-8859-1) instead of UTF-8. This is based on the info I found in this bug report.

  • Open prototype.js and replace all calls to encodeURIComponent() with escape(). There should be three instances.
  • On the server side, make sure you send all output wrapped with htmlentities(), or else you may experience that the editor ‘hangs’ when updating.

That’s it!