Howdy, Stranger!

It looks like you're new here. If you want to get involved, click one of these buttons!

Categories

Can you see an error here?

Jason GJason G Member Posts: 62
[b][red]This message was edited by the Jason G at 2002-7-20 8:58:4[/red][/b][hr]
Hi. I've been writting 2 small functions to change a image in a html page when the user presses a button. As far as I can tell the code is OK, but IE says there a ; missing on line 11 char 11! I'm knowledge is mostly in C++, but since JS and c++ are similar, i thought this would be easy!! :-( Well heres the code:

[code]


var page = 0;
var widths[4] = {611,658,897,1201};
var urls[4] = {"ycg01cover.jpg","ycg01frontA","ycg01frontB","ycg01back.jpg"};

function NextImg()
{
if(page == 3)
{
page = 0;
}
else
{
page += 1;
}

document.img1.src = urls[page];
document.img1.width = widths[page];

return;
}

function PrevImg()
{
if(page == 0)
{
page = 3;
}
else
{
page -= 1;
}

document.img1.src = urls[page];
document.img1.width = widths[page];

return;
}


[/code]

thx,

-J

____________________________________________

:S Confused? Me too! :S


Sign In or Register to comment.