[XSL-LIST Mailing List Archive Home] [By Thread] [By Date] [Recent Entries] [Reply To This Message] Re: javascript problem
[Paul Kelly] > This is not an xslt issue, it is a web page design issue. You should make sure that you get your HTML working right first, ***before*** trying to create it with a stylesheet. > Can someone please tell me why this script will not execute: > > <head> > <xsl:copy-of select="document('meta')/meta" /> > <title><xsl:value-of select="page/@title"/></title> > <script language="JavaScript"> > { > document.write("<link rel='stylesheet' href='css.css' > type='text/css' />"); > } > </script> > </head> > > This does not execute because it is in the head of the document. The only way to be sure when it will execute, is to define a function and call that function from some event, like the onLoad event defined in the body element. In this case, it is a good thing you do not get results because writing to the document after it has completed could wipe it out completely, including the code that writes to the document. > But this one will (it's further down inside the body of the html output): > > <script language="JavaScript"> > { > document.write("<hr width='10' />"); > } > </script> > This executes when the page builder works its way down to this part of the page. But why not just put in the html directly at this point? You are only putting in a simple html element. Cheers, Tom P XSL-List info and archive: http://www.mulberrytech.com/xsl/xsl-list
|
PURCHASE STYLUS STUDIO ONLINE TODAY!Purchasing Stylus Studio from our online shop is Easy, Secure and Value Priced! Download The World's Best XML IDE!Accelerate XML development with our award-winning XML IDE - Download a free trial today! Subscribe in XML format
|