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="javascript">
<!--
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>
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="javascript">
<!--
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>