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 strongm on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

runtime error: using javascript calls from xsl

Status
Not open for further replies.

Candyb

Technical User
Oct 2, 2001
12
CA
Hi,

If I have an xsl doc that calls a javascript function, I am unsure of where to keep my dynamic array that I created. Do I keep the array in the functions or outside it.

If outside it, is the array always there after the first call to add something to it so I can do second and third calls etc?

I guess what i am sayin is if i leave it outside it is global and will always be available whenever a function calls to use it. here is my code...is it correct?

I am trying to debug and i don't know if the error is bc i am not passing a correct parameter type or if it has to do with my javascipt. The error is :

Microsoft JScript runtime error Object expected line = 1, col = 0 (line is offset from the tag). Error returned from property or method call.


<script language=&quot;javascript&quot;>
<!--
var arr = new Array();
function inArray(strTitle)
{
var i;
for(i = 0; i < arr.length; i++) {
if (strTitle == arr)
return false; } //returns false so xsl:if will not execute
else
return true;
}

// Adds the node element name to array
function addNode(strtitle)
{
arr[arr.length]= strtitle;
}

//-->
</script>
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top