Click to See Complete Forum and Search --> : javascript & XHTML problem


marye
01-03-2003, 10:35 AM
I'm using DreamWeaverMX. Using DWMX's auto-convert, I converted my site from HTML to XHTML. The "fly-out" menus that had been working fine in all browers & vers, suddenly stopped working at all.

From the DWMX list, I determined the DWMX was appendng "1.2" to Javascript in the <script> tag & that this "1.2" should be removed to make the "fly-outs" work again. I removed the "1.2" & the "fly-outs" now work in Netscape4.7, but still won't work in IE6 or Beonex0.8.1 (which I believe should produce the same results as Netscape7).

I am not a programmer, but a programmer took a quick look for me. His early assessment is that the fly-out menus are never being called. Does anyone have more ideas for me to investigate? Anyone know any "standard" javascript/XHTML "gotchas"?

All suggestions appreciated!

Mary E.

Zach Elfers
01-03-2003, 10:46 AM
Ok, I think this is the problem. If you have characters like ">" in your script, the XML parser will think that they are errors in the punctuation or whatever. You could either make your script external, or you could hide it with:

<[CDATA[

your script

]]>

marye
01-03-2003, 10:56 AM
Scripts are already external. :-\

Also, please clarify for me... Other sources on the web indicated I should use (note the !):

<![CDATA[

your script

]]>

I tried copy/pasting the menu script into the XHTML page itself, enclosing it with the above, but browsers gave me a js error. You indicate there should not be a "!" with the CDATA. Correct?

Mary E.

Zach Elfers
01-03-2003, 10:58 AM
Yes, you are right. You need the !. I am sorry. I forgot about that. I am not sure if scripts being external has anything to do with that. The reason I mentioned that is because I had those characters in a script in an XHTML page, and when I made the script external, everything was fine.

marye
01-03-2003, 11:07 AM
However, even using the "!", IE6 & B081 were returning a js error indicating that the <![CDATA was the issue. ??

Other suggestions to check, Zach or anyone?

Mary E.

khalidali63
01-03-2003, 11:09 AM
I'd say take a good look at your code,all of it,and make sure that there is not a single tag that does not have an ending tag.
All the attribute's values must be enclosed in dowble qoutes,and this is my guess, potentially your problem.
having seen all kinds of WYSIWYG created codes in this forum,I bet there are allots of attribute values in your javascript that are not enclosed within the double quotes.

Just an Idea..:-)

Khalid

marye
01-03-2003, 11:23 AM
OK. I'll go there (ick).

One of the weirdest things is that it's working in NS4.7, but not IE6. When things don't work, it's usually the other way around.

Thanks & please keep those suggestions coming!

Mary E.