htmlArea

A directory of browser-based WYSIWYG editors

  MAIN
INDEX
SEARCH
POSTS
WHO'S
ONLINE
LOG
IN

Home: htmlArea 3 (beta): htmlArea 2 & 3 archive (read only): htmlArea v3.0 - Discussion:
How the $%#! does Insert Image work?! Trying to customize


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.

 


wreimer
Novice

Feb 4, 2005, 2:10 PM

Post #1 of 1 (2174 views)
Shortcut
How the $%#! does Insert Image work?! Trying to customize Can't Post

I've been working with htmlArea for a couple of months and consider myself a pretty good js coder, but I'm lost with how (parts of) Insert Image works, in particular, how does the img object get created? For instance:


Code
for (var field in param) { 
var value = param[field];
switch (field) {
case "f_alt" : img.alt = value; break;
case "f_border" : img.border = parseInt(value || "0"); break;
// etc...
}
}


These lines appear to be setting image attributes, but if you do a test right before the above code, like alert(img.tagName) you get an error (in Firefox at least) or alert(img==null) you get 'true'... So it appears to be setting attributes on a null object. When does it beome an image object (or HTML code)?

TIA,
Wes

 
 
 


Search for (options)