I thought about AJAX for that same reason (page doesn't have to reload, but the "heavy weight" conversion logic can reside on the server), but I have to admit I'm a bit ignorant about AJAX.  How universal is the XMLHttpRequest support in modern browsers (Safari, Opera, Firefox/Camino/Mozilla, etc.)?  Are we restricting support and compatibility by introducing that technology?

 

On Thu, 8 Jun 2006 08:53:05 +0800, "Derek Hinchliffe" wrote:

On 6/7/06, Eric Stadtherr  wrote:
>
> The other issue I'm trying to solve is more of a browser/client issue. If a
> user has typed a message using the HTML editor, and then uses the toggle
> button to switch to the plain text editor, it would be ideal if this same
> HTML->Text rendering were performed. However, the PHP solution is a "back
> end" solution that would require another trip to the server.
>
> I see three options:
> empty the text field when switching editor types (users will be mad)
> re-post the page when switching editor types, so the PHP HTML->Text or
> Text->HTML can be done on the server (slow and kind of an interruption)
> do the conversion in JavaScript in the browser (TinyMCE doesn't do this, so
> we'd have to find a JavaScript implementation of an HTML->Text renderer)
>
> Any thoughts or other options? If #2 is the choice, I'd also like to ask
> for suggestions as to the best way to implement it.
>

A robust Javascript implementation would definitely be nice from the
user PoV. Another option which is in between the two you have
mentioned is to use AJAX principles - use Javascript to send the HTML
to the backend and receive the plain text back. So still a server
post/fetch but there is no full page reload involved and it is more
seamless for the user.

Cheers
Derek