Forum closed. New forum available at http://community.wymeditor.org/

(renamed) Beware of JQuery variable names

Support forum for WYMeditor.

(renamed) Beware of JQuery variable names

Postby Bravo_Kernel on Sun Jun 24, 2007 2:06 pm

Hi guys,

0.3 looks awesome guys, keep it up!
One question though: I have a page with two textareas (both with the same classname) but only the first one seems to get "loaded" by WYM. The other one just stays a plain textarea. Am I missing an option or something?

TIA,
Bravo

Update:
I created some simple html using two textareas and everything works flawlessly so no bug in WYM. I am starting to think that my xhtml is broken and that JQuery is not finding the other textarea. As soon as I find out how to debug JQuery I'll post the outcome.

Update2:
This is unreal.... the reason WYM broke is because I had an input element in my html that was named "nodeName". It turns out that JQuery uses the same name as a variable or something (case-sensitive). Simply put: do not use variable names used in JQuery to name your elements or very bad things will happen.

Maybe this will be helpful for someone in the future.

Bravo :roll:
Bravo_Kernel
 
Posts: 10
Joined: Sat Feb 10, 2007 1:52 pm

Postby Bravo_Kernel on Tue Jun 26, 2007 12:51 pm

Allright, it turns out that the problem was indeed related to (but not caused by) JQuery.

The workaround is simple but vital: always use a prefix for all your HTML elements to prevent conflicts with the DOM model.

Background information about this issue is explained in full detail at the JQuery Development Maillist in this thread: http://groups.google.com/group/jquery-dev/browse_thread/thread/7cc518e4b7a6978e.

HTH,
Bravo
Bravo_Kernel
 
Posts: 10
Joined: Sat Feb 10, 2007 1:52 pm


Return to Support

Who is online

Users browsing this forum: No registered users and 1 guest