A directory of browser-based WYSIWYG editors


Home: htmlArea 3 (beta): htmlArea 2 & 3 archive (read only): htmlArea v3.0 - Discussion:
[Patch] HTMLArea is not compatible with other scripts!

The htmlArea 2 & 3 editors have been discontinued.

We've made these forums available as a read-only reference and knowledge-base for people using or developing editors based on htmlArea 2 or 3.

Anyone who is interested in taking over version 2 or 3 is free to do so. All we ask is that you choose a new name that doesn't have "htmlarea" in it to avoid confusion with this site. We'll even give you a link in the directory to make it easier for people to find you. If you are developing or hosting an htmlArea based-editor under a new name, please submit it to our directory.



Feb 5, 2004, 2:59 AM

Post #1 of 1 (688 views)
[Patch] HTMLArea is not compatible with other scripts! Can't Post

I tried to use HTMLArea within my existing project. It didn't work at all because of alot of alert messages.

After investigating the source code of HTMLArea I found the problem:
- I am using a custom method for the Array and Object prototypes - serialize() - which serializes the Object into a string.
- HTMLArea uses for/in syntax to loop over an Array.
- BUT: For/in loops also custom methods why HTMLArea breaks at some points of the source.

Therefore I added a check for each of the loops. For Example:

for (var i in this.btnList) { 
var btn = this.btnList;
if (typeof btn == 'function') continue; /* FIXME: Compatibility with custom methods */

It now works with the customized prototypes I use. But I am not sure if this patch breaks other parts of htmlArea.

Attached you find a ZIP containing both the modified source files (latest CVS snapshot - checked out today: Feb, 5th 2004) and a .diff Smile

I don't like my patch too much. Perhaps the for/in loops should be / can be converted to simple for ( ... ) loops which don't have this problem.
Also I think this is a bug / problem of htmlArea because I see no reason why customized prototypes shouldn't work in conjunction with htmlArea. It's a very cool feature of JavaScript and saves a lot of lines of code.

Any opinions? Any chance that this or a similar patch can be applied to htmlArea 3.0?

[EDIT] Here's an external link for the patch:

(This post was edited by arabold on Feb 5, 2004, 3:03 AM)
Attachments: (25.2 KB)


Search for (options)