Hi there i have this problem about a simple menu in xslt
i want everytime i click on it a new window to be open here is the peace of code how i am doing that :
<a onclick="window.open('{@FriendlyHref}',menubar=1,resizable=1,width=350,height=250);return false;">
<xsl:attribute name="href">javascript:void(0);
</xsl:attribute>
<xsl:value-of select="@MenuText" disable-output-escaping="yes"/>
</a>
but i doesnot work on firefox any idea on what i am doing wrong??
thanks in advance
Developer forum
E-mail notifications
xslt & javascript
Posted on 06/11/2009 15:05:03
Replies
Nicolai Høeg Pedersen
Posted on 08/11/2009 16:28:54
Because of your "return false" on the onclick...
You should use one of these combinations:
href="#" onclick="window.open(..."
OR
href="javascript:window.open(..."
You should use one of these combinations:
href="#" onclick="window.open(..."
OR
href="javascript:window.open(..."
Posted on 09/11/2009 10:00:41
I tried both of this combination but still not working on firefox and i think the problem has to do with javascript:void(0); !!!
Posted on 09/11/2009 10:56:24
Hi Stravos,
I used this code to correct the href's when the FriendlyHref came with javascript:window.open. Maybe you can get something to work with.
<a>
<xsl:choose>
<xsl:when test="substring(@FriendlyHref,1,10)='javascript'">
<xsl:attribute name="href">#</xsl:attribute>
<xsl:attribute name="onClick"><xsl:value-of select="@FriendlyHref" disable-output-escaping="yes"/></xsl:attribute>
</xsl:when>
<xsl:otherwise>
<xsl:attribute name="href"><xsl:value-of select="@FriendlyHref" disable-output-escaping="yes"/></xsl:attribute>
</xsl:otherwise>
</xslchoose>
</a>
Best Regards,
Nuno
I used this code to correct the href's when the FriendlyHref came with javascript:window.open. Maybe you can get something to work with.
<a>
<xsl:choose>
<xsl:when test="substring(@FriendlyHref,1,10)='javascript'">
<xsl:attribute name="href">#</xsl:attribute>
<xsl:attribute name="onClick"><xsl:value-of select="@FriendlyHref" disable-output-escaping="yes"/></xsl:attribute>
</xsl:when>
<xsl:otherwise>
<xsl:attribute name="href"><xsl:value-of select="@FriendlyHref" disable-output-escaping="yes"/></xsl:attribute>
</xsl:otherwise>
</xslchoose>
</a>
Best Regards,
Nuno
Nicolai Høeg Pedersen
Posted on 09/11/2009 11:01:18
Stavros - your problem is the "return false" after your window.open....
Posted on 09/11/2009 13:41:09
Thanks !!
for the replay nicolai you were right! but for a reason the page was cashed and i couldn't see the results!!
for the replay nicolai you were right! but for a reason the page was cashed and i couldn't see the results!!
You must be logged in to post in the forum