caballonegro
07-27-2002, 11:31 PM
Hello
I'm beginner of java scripting and have a little problem
In my html file i define a array
mypics=new Array(
"images/zulauf_100.jpg",
"images/zulauf_450_S.jpg",
"images/ablauf_100.jpg",
"images/ablauf_450_S.jpg"
)
in a separate javascriptfile i have a function
function doanything()
{
i=0;
anzahl=mypics.length;
while (i < (anzahl))
{
document.writeln(mypics[i] + "<br>");
i++;
}
}
but this not work.
If both codings in the same htmlfile it works.
may be it works there because the array is global.
I think the problem is to transfer this array conntent to an external function.
How is the right way to transfer an array to a function in a separate javascriptfile
thanks
Susanna
I'm beginner of java scripting and have a little problem
In my html file i define a array
mypics=new Array(
"images/zulauf_100.jpg",
"images/zulauf_450_S.jpg",
"images/ablauf_100.jpg",
"images/ablauf_450_S.jpg"
)
in a separate javascriptfile i have a function
function doanything()
{
i=0;
anzahl=mypics.length;
while (i < (anzahl))
{
document.writeln(mypics[i] + "<br>");
i++;
}
}
but this not work.
If both codings in the same htmlfile it works.
may be it works there because the array is global.
I think the problem is to transfer this array conntent to an external function.
How is the right way to transfer an array to a function in a separate javascriptfile
thanks
Susanna