PDA

View Full Version : Floating Menu Script Problem



kwroberts
12-12-2005, 07:37 PM
I am having trouble getting this script to work:
http://www.dynamicdrive.com/dynamicindex1/staticmenu.htm

I get the image I am using for a imagemap menu to show but it doesn't move as you scroll.

However, the real problem is I would like to get this to work from a .XSL file. I inserted the code as directed just before the </body> tag and it causes a XML failure saying the </script> tag is coming before and ending tag for <div>.

Any assistance would be appreciated.

Ken

jscheuer1
12-13-2005, 06:09 AM
I'd have to see your page to help with the first problem. The second problem, I think you may have explained incorrectly. It is perhaps more likely that the </script> tag comes after a closing </div>. However, the way you explained it may be the way the xml parser sees it. In any event, what you can try is to locate any closing tags inside the script (usually found in variable assignments, 'innerHTML=' statements, and 'document.write' or 'document.writeLn' statements and escape their /'s with \'s, example:

<\/div>

If there is an actual </script> tag inside the script as part of a variable, innerHTML, or write statement, it needs special handling but, should already have it as, that would be a problem in normal HTML as well (all except for the escaping \, highlighted red). It should be treated like so or similar (there are other workable ways):


document.write('<'+'\/'+'s'+'cript>')

Also, it is a good idea to make all javascripts external for XHTML/xml.