Need to run Javascript during XSL transformation

I have a web page where the html is created via an XSL stylesheet. The data is in a table, row, column format. One of the columns has a link button that when clicked some javascript builds a table of data and inserts it under the existing row. The user wants this table displayed always (without clicking the link).

Question: How do I get my existing javascript to run in-place when the page is loaded?

<td width="15%" onmouseover="MouseOver(this)" align="right" onclick="ShowUsage('{CITEM}', '{WUSED}')" >
		<font size="1" face="Tahoma" color="#004080">
			<U>raw materials</U>

Open in new window

Bob HoffmanDeveloperAsked:
Who is Participating?
Bob HoffmanConnect With a Mentor DeveloperAuthor Commented:
 I think the below code snipet illustrates how I'm suppose to do it, but when I run it I get a "ClassNotFoundExecption" on urn:custom-javascript. I have no clue how to fix that error.
or maybe this approach is all wrong?

<xsl:stylesheet version="1.0" xmlns:xsl="" 
<msxsl:script language="JavaScript" implements-prefix="js"> 
function ShowUsage(item, wused)  
 // my code
<td colspan="4">
     <xsl:value-of select="js:ShowUsage('{CITEM}', '{WUSED}')"/>
								 <xsl:value-of select="js:ShowUsage('{CITEM}', '{WUSED}')"/>

Open in new window

A zillion ways to do it, this is the most basic:

<body onload="ShowUsage('{CITEM}', '{WUSED}')">
Bob HoffmanDeveloperAuthor Commented:
It needs to run once for each row in the table.
Question has a verified solution.

Are you are experiencing a similar issue? Get a personalized answer when you ask a related question.

Have a better answer? Share it in a comment.

All Courses

From novice to tech pro — start learning today.