逻辑:在XSL中获得XML中节点picPath的值例如:/templets/images/test.jpg|/templets/images/ad_1.gif|/templets/images/ad_2.jpg|声明变量
<xsl:variable name="picPath" select="picPath"/>将值传给JS函数<div onload="CutPic($picPath)">JS函数为
funtion CutPic(picPath)
{
}问题:无法将picPath的值传给JS函数CutPic()中请大虾们帮帮忙,在线等!
<xsl:variable name="picPath" select="picPath"/>将值传给JS函数<div onload="CutPic($picPath)">JS函数为
funtion CutPic(picPath)
{
}问题:无法将picPath的值传给JS函数CutPic()中请大虾们帮帮忙,在线等!
<input id="picUrl" type="hidden">
<xsl:attribute name="value">
<xsl:value-of select="$picPath"/>
</xsl:attribute>
</input>
把值保存到隐藏域,用户的时候再获取
<div id="pic" value="/templets/images/test.jpg|/templets/images/ad_1.gif|/templets/images/ad_2.jpg|
">然后在JS中获取
var picPath = document.getElementById("pic").value;