beezleboss
25 Jan 2010, 12:42 PM
I'm having trouble getting my head around XSLT. I am creating an html table and filling it with the xml data using jascript.
i have it basically working but the next thing I want to do is call a javascript function and pass it one of the xml values as a parameter.
I'm trying it with a very simple class at the moment to see if I can get it to work; this is my code.
Function:
function loadMsg(mId)
{
alert(mId);
}
XSLT (snippet):
<tr class="msgListItem" onmouseover="style.backgroundColor='#ff0000';"
onmouseout="style.backgroundColor='#ffffff';"
onclick='loadMsg(<xsl:value-of select="mailid"/>);'>
I know everything works as expected when I do:
<tr class="msgListItem" onmouseover="style.backgroundColor='#ff0000';"
onmouseout="style.backgroundColor='#ffffff';"
onclick='loadMsg("some text");'>
anyone have any ideas?
thanks
i have it basically working but the next thing I want to do is call a javascript function and pass it one of the xml values as a parameter.
I'm trying it with a very simple class at the moment to see if I can get it to work; this is my code.
Function:
function loadMsg(mId)
{
alert(mId);
}
XSLT (snippet):
<tr class="msgListItem" onmouseover="style.backgroundColor='#ff0000';"
onmouseout="style.backgroundColor='#ffffff';"
onclick='loadMsg(<xsl:value-of select="mailid"/>);'>
I know everything works as expected when I do:
<tr class="msgListItem" onmouseover="style.backgroundColor='#ff0000';"
onmouseout="style.backgroundColor='#ffffff';"
onclick='loadMsg("some text");'>
anyone have any ideas?
thanks