Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations biv343 on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Passing global javascript variables into xml

Status
Not open for further replies.

benushroff

Programmer
Aug 30, 2004
1
US
Here is what I want to do.

I have a global variable defined in my xsl.

<script>
var colOrder = 0;
</script>


I have a template which takes a parameter ColToSort. That param needs to be passed back to a javascript function.

The javascript function presortTable changes the value of colOrder. However whenever I alert the value of colOrder, it always is 0.

I am expecting the value of global variable colOrder to change whenever we call template x.

Any help would be appreciated. Thanks in advance.


<xsl:call-template name="x">
<xsl:with-param name="ColToSort" select="'ColOrder'"/>
</xsl:call-template>

<xsl:template name="x">
<xsl:param name="ColToSort" />
javascript::presorttable(0,$ColToSort);
</xsl:call-template>

--JAVASCRIPT function----

function presortTable(col, colSort){
alert(colSort);
colSort = 5;
}
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top