JavaScript in XSL - doesn't work

admin

Administrator
Staff member
Well when i used this script in pure html it worked perfectly but when i moved it to xsl it shows error that object was expected...

my script in xsl:


<xsl:comment><![CDATA[
function ShowMessage(text,id)
{
top_pos = y +100+ 'px';
left_pos = x -220 + 'px';
document.body.insertAdjacentHTML('BeforeEnd', '<DIV STYLE="position:absolute; TOP:' + top_pos + '; LEFT:' + left_pos + ';" ID="' + id + '"><table border="0" cellpadding="1" cellspacing="0"><tr><td><img src=http://www.webdeveloper.com/forum/archive/index.php/"' + text + '"/></td></tr></table></DIV>');
}

function Kill(id)
{
id.innerHTML = "";
id.outerHTML = "";
}
function XY(e)
{
y=e.clientY + document.body.scrollTop;
x= e.clientX + document.body.scrollLeft;
}
]]></xsl:comment>


then, somewhere in xsl:

<td align="center"><a onmouseover="if (window.event) XY(event); ShowMessage('graph/chelsea.gif', 'id1')" onmouseout="Kill('id1')" HREF=http://www.webdeveloper.com/forum/archive/index.php/"http://www.chelsea.com">Chelsea</a></td>

Maybe someone can tell me what am I doing wrong?
 
Back
Top