Hi, since I'm new here, not sure if this is the right place to post
a question, so excuse me if it's not)
So the goal is to parse links from XML into array to cycle them in an
iframe with next/prev buttons, if an array is hardcoded everything works
fine, but if I parse it trouble starts.
Array.length reads and even loads s[0], but stays there simly reloading
the page with next/prev buttons.
function array() is loaded from a different .js and works fine, array exists.
What could be the problem?
[code]
var s=array();
var adr,i,x=0,c=s.length;
function next(){
alert(s.length);
x+=1;
if (x>c-1)
{
x=0;
}
changeSrc();
}
function prev(){
x-=1;
if (x<=0)
{
x=c-1;
}
changeSrc();
}
function changeSrc() {
document.getElementById("fm").src=s[x];
}
function begin() {
document.getElementById("fm").src=s[0];
}
[/code]