[XSL-LIST Mailing List Archive Home] [By Thread] [By Date] [Recent Entries] [Reply To This Message]

Re: XSL transformations with Javascript

Subject: Re: XSL transformations with Javascript
From: "David Rigby" <D.A.Rigby@xxxxxxxxxxxxxx>
Date: Mon, 4 Jun 2001 20:22:39 +0100
inerhtml
Hmm this is interesting - I hadn't realised <script> was valid anywhere
(rummages thru w3c docs :) ) - funnily enough my initial reply was to the
effect of your parsing argument but then I had <script> inside a <head> in
my (erm) head and sorta (incorrectly) extrapolated to the <script> tag being
invalid everywhere else.  Oops - my mistake!!! *apologises profusely* :)

David


----- Original Message -----
From: "Chris Bayes" <Chris@xxxxxxxxxxx>
To: <xsl-list@xxxxxxxxxxxxxxxxxxxxxx>
Sent: Monday, June 04, 2001 7:35 PM
Subject: RE:  XSL transformations with Javascript


> David,
> >As far as the alert is concerned, you won't see any code executed since
the
> >innerHTML property of a DIV cannot contain <script> tags (no body element
> >can - they go in <head>).  Hence your <script> element (and anything else
> >that should go in <head>) will be ignored.  To make that work you'd need
to
> >load the results of the transform in a frame or a new window of some
sort.
>
> That isn't quite true. You can put a <script anywhere.
> But I wasn't looking at it from this angle.
> The problem is that when you do ...innerHTML = something with a <script
> it is inserted but not parsed as it is when the page is initially loaded.
So things like
> <script...
> function x(){alert("x")}
> </script>
> are inserted but not parsed. The only way I have got round it in the past
is to
> <script id="someScriptID">
> function x(){alert("x")}
> </script>
> ...inerHTML = something containing above script;
> eval(document.all("someScriptID").innerText);
> x();
>
> Ciao Chris
>
> XML/XSL Portal
> http://www.bayes.co.uk/xml
>
>
>  XSL-List info and archive:  http://www.mulberrytech.com/xsl/xsl-list
>
>


 XSL-List info and archive:  http://www.mulberrytech.com/xsl/xsl-list


Current Thread

PURCHASE STYLUS STUDIO ONLINE TODAY!

Purchasing Stylus Studio from our online shop is Easy, Secure and Value Priced!

Buy Stylus Studio Now

Download The World's Best XML IDE!

Accelerate XML development with our award-winning XML IDE - Download a free trial today!

Don't miss another message! Subscribe to this list today.
Email
First Name
Last Name
Company
Subscribe in XML format
RSS 2.0
Atom 0.3
Site Map | Privacy Policy | Terms of Use | Trademarks
Free Stylus Studio XML Training:
W3C Member
Stylus Studio® and DataDirect XQuery ™are products from DataDirect Technologies, is a registered trademark of Progress Software Corporation, in the U.S. and other countries. © 2004-2013 All Rights Reserved.