Altova Mailing List Archives>Archive Index >microsoft.public.xsl Archive Home >Recent entries [Thread Prev] >Thread Next - Re: javascipt in xsl not working javascipt in xsl not workingTo: NULL Date: 5/8/2006 4:07:00 AM
i can't figure this one out for the life of me, so i hope someone here
can help
this is the setup:
i have an asp page that retuns xml that is then transformed into an
xhtml page by an xsl file
in that xhtml page i use ajax to load and transfom more xml into
xhtml/javascript which is appended to the document.body
now, the ajax transforms the xml properly, but when it's appended all
the html elements render but none of the javascript is usable.
in firefox it works perfectly, but ie craps out with the javascript (i
have a sneaky suspicion why it might be happening, but i'm hoping i'm
wrong)
can anyone tell me what stupid mistake i might be making?
thanks in advance
this is an edited copy of the xsl file(this one doesn't render the js
either):
<?xml version="1.0" encoding="ISO-8859-1"?>
<xsl:stylesheet version="1.0"
xmlns:xsl="http://www.w3.org/1999/XSL/Transform"
xmlns:ec="http://e.c/">
<xsl:template match="/">
<div
style="position:absolute;top:0px;left:0px;width:790px;height:412px;">
<div height="15px">
[user: <xsl:value-of select="//ec:user/text()"/> ]
</div>
<div>
<table
style="width:790px;height:397px;background-color:#c0c0c0;padding:0px;">
<tr style="padding:0px;">
<td style="width:100px;height:391px;background-color:#f0f0f0;">
<div style="height:100%;width:100%;">
<xsl:for-each select="//ec:ml/panel">
<xsl:element name="div">
<xsl:attribute name="align">center</xsl:attribute>
<xsl:attribute name="style">border:1px solid
#c0c0c0;padding:1px;margin:1px;cursor:pointer;</xsl:attribute>
<xsl:attribute name="onclick">
hyLink('addr<xsl:value-of select="@id"/>Bod');
</xsl:attribute>
<xsl:value-of select="@name"/>
</xsl:element>
</xsl:for-each>
</div>
</td>
<td style="width:675px;height:391px;background-color:#f0f0f0;">
<div style="height:100%;width:100%;">
<xsl:for-each select="//ec:ml/panel">
<xsl:if test="child::tab!=''">
<xsl:element name="div">
<xsl:attribute name="id">addr<xsl:value-of
select="@id"/>Bod</xsl:attribute>
<xsl:attribute name="style">display:none;</xsl:attribute>
</xsl:element>
</xsl:if>
<xsl:if test="not(child::tab!='')">
<xsl:element name="div">
<xsl:attribute name="id">addr<xsl:value-of
select="@id"/>Bod</xsl:attribute>
<xsl:attribute name="style">display:none;</xsl:attribute>
</xsl:element>
</xsl:if>
</xsl:for-each>
</div>
</td>
</tr>
</table>
</div>
</div>
<script type="text/javascript">
try{
alert("test");
}
catch(e){
alert("error: \n"+e.message);
}
</script>
</xsl:template>
</xsl:stylesheet>
| ||||||
| Company | Legal | Press | Partners | Careers | Sitemap | Contact Us | Altova Blog | Mobile | Full Site | |||
|
