Fwd: Re: [Hypercontent-users] javascript output
Brought to you by:
alexvigdor
From: Pete B. <pb...@ia...> - 2005-03-07 15:33:32
|
Another method is to use <xsl:comment> as in: <script language="JavaScript"> <xsl:comment> if (r && (!chain || r.chain==chain) && r.msg==msg) </xsl:comment> </script> Note the I escape & and <> in the javascript but it gets converted on output. This is important in uP2.4.2 because the new serializer causes problems otherwise. I also found that you shouldn't use " in the javascript because it will be converted to "e; on output. Using only single quotes solves that problem. >>From popserve Mon Mar 7 08:38:46 2005 >Cc: "'Hypercontent-users'" <hyp...@li...> >From: Adam Carl <ac...@co...> >Subject: Re: [Hypercontent-users] javascript output >To: Carl Barrow <C.P...@hu...> >X-Mailer: Apple Mail (2.619.2) >X-No-Spam-Score: Local >X-Scanned-By: MIMEDefang 2.48 on 128.59.29.8 >X-Spam-Score: 0.5 (/) >X-Spam-Report: Spam Filtering performed by sourceforge.net. > See http://spamassassin.org/tag/ for more details. > Report problems to http://sf.net/tracker/?func=add&group_id=1&atid=200001 > 0.5 FROM_ENDS_IN_NUMS From: ends in numbers >Sender: hyp...@li... >X-BeenThere: hyp...@li... >X-Mailman-Version: 2.0.9-sf.net >List-Unsubscribe: <https://lists.sourceforge.net/lists/listinfo/hypercontent-users>, > <mailto:hyp...@li...?subject=unsubscribe> >List-Id: JA-SIG - HyperContent Users discussion list <hypercontent-users.lists.sourceforge.net> >List-Post: <mailto:hyp...@li...> >List-Help: <mailto:hyp...@li...?subject=help> >List-Subscribe: <https://lists.sourceforge.net/lists/listinfo/hypercontent-users>, > <mailto:hyp...@li...?subject=subscribe> >List-Archive: <http://sourceforge.net/mailarchive/forum.php?forum=hypercontent-users> >Date: Mon, 7 Mar 2005 09:42:44 -0500 >X-PMX-Version: 4.7.0.111621, Antispam-Engine: 2.0.0.0, Antispam-Data: 2005.3.7.5 >X-Perlmx-Spam: Gauge=IIIIIII, Probability=7%, Report='__C230066_P5 0, __CT 0, __CTE 0, __CT_TEXT_PLAIN 0, __HAS_MSGID 0, __HAS_X_MAILER 0, __MIME_VERSION 0, __SANE_MSGID 0' > >Carl, > >Use a text element and disable output escaping > >See example below: > ><xsl:text disable-output-escaping="yes"> >function clickLink1(){ > > top.location = group1links[group1Size] > >} > >function clickLink2(){ > > top.location = group2links[group2Size] >} > ></xsl:text> > >Adam > >On Mar 7, 2005, at 8:26 AM, Carl Barrow wrote: > >>Hi Alex >> >>I have had to incorporate a javascript menu into one of my templates because Marketing have used it on the University Site. I don't have a problem adding it to the template, the page builds without problem. >>However, some of the code is being escaped on output : >> >>if (r && (!chain || r.chain==chain) && r.msg==msg) >> >>becomes >> >>if (r && (!chain || r.chain==chain) && r.msg==msg) >> >>The output method is set to html in my template and I've used CDATA tags round all javascript. >>Do you have any idea how I might overcome this? >> >>Thanks >>Carl >> >>-- >>************************************ >> >>Carl Barrow >>Web Developer >>e-Services >>The University of Hull >>Cottingham Road >>Hull >>HU6 7RX >>Ext. 6838 >>************************************ >> >> >> >>------------------------------------------------------- >>SF email is sponsored by - The IT Product Guide >>Read honest & candid reviews on hundreds of IT Products from real users. >>Discover which products truly live up to the hype. Start reading now. >>http://ads.osdn.com/?ad_id=6595&alloc_id=14396&op=click >>_______________________________________________ >>Hypercontent-users mailing list >>Hyp...@li... >>https://lists.sourceforge.net/lists/listinfo/hypercontent-users >Adam Carl >AIS Web Services >(212) 854-0131 >ac...@co... > > > >------------------------------------------------------- >SF email is sponsored by - The IT Product Guide >Read honest & candid reviews on hundreds of IT Products from real users. >Discover which products truly live up to the hype. Start reading now. >http://ads.osdn.com/?ad_id=6595&alloc_id=14396&op=click >_______________________________________________ >Hypercontent-users mailing list >Hyp...@li... >https://lists.sourceforge.net/lists/listinfo/hypercontent-users Pete Boysen Iowa State University pb...@ia... (515)294-6663 Ames, Iowa 50011 http://www.public.iastate.edu/~pboysen |