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 - Add-Ons:
Problem with Mozilla


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.

 


Lorenzo
Novice

Nov 10, 2004, 4:39 AM

Post #1 of 5 (6424 views)
Shortcut
Problem with Mozilla Can't Post

Hello! I've written a piece of code for a new add-on.

The code must change the classname of some object of a document with another classname.

I don't know IDs of those object.
I've written this code, it works very well in IE, but MOZILLA says me that document.all is not standard, so it works very VERY slow (because of exceptions i think).
The code is:


Code
   

for (i=0; i<document.all.lenght; i++) {
var obj = document.all(i);
if (obj.className=="oldcssname") obj.className=="newcssname";
}



How can I make it work well in MOZILLA?
It's quite important, please, answer me!


gocher
Novice

Nov 12, 2004, 2:26 AM

Post #2 of 5 (6350 views)
Shortcut
Re: [Lorenzo] Problem with Mozilla [In reply to] Can't Post

Hello Lorenzo,

you have to use document.getElementByID()


Lorenzo
Novice

Nov 12, 2004, 4:00 AM

Post #3 of 5 (6346 views)
Shortcut
Re: [gocher] Problem with Mozilla [In reply to] Can't Post

I know I have to use it, but how i can have EACH element of the document with that instruction?

Thank you


gocher
Novice

Nov 15, 2004, 4:34 AM

Post #4 of 5 (6242 views)
Shortcut
Re: [Lorenzo] Problem with Mozilla [In reply to] Can't Post

Hello Lorenzo,

here is the code you are looking for!

var alltags=document.all? document.all : document.getElementsByTagName("*");
for (i=0; i<alltags.length; i++){
if (alltags[i].className=="oldclassname")
alltags[i].className="newclassname";
}


Lorenzo
Novice

Nov 15, 2004, 11:05 AM

Post #5 of 5 (6218 views)
Shortcut
Re: [gocher] Problem with Mozilla [In reply to] Can't Post

Thank you very much! It's OK. Wink

 
 
 


Search for (options)