Uncaught SyntaxError: missing ) after argument list?

Uncaught SyntaxError: missing ) after argument list?

首先,我知道这是一个相对常见的错误,但似乎每次都有不同的解决方案,所以我发帖希望得到帮助。这是我的 javascript:

function showstuff(boxid, me, alternate, number){
    document.getElementById(boxid).style.visibility="visible";
    if (typeof number !== 'undefined') {
        document.getElementById(boxid).style.height="number"+"px";

    }
    else { document.getElementById(boxid).style.height="215px";
    }
    document.getElementById(me).style.display="none";
    document.getElementById(alternate).style.display="inline";
}

function hidestuff(boxid, me, alternate){
    document.getElementById(boxid).style.visibility="hidden";
    document.getElementById(boxid).style.height="0px";
    if (typeof alternate !== 'undefined') {
            document.getElementById(me).style.display="none";
            document.getElementById(alternate).style.display="inline";
    }
}

这里是 html 它引用的是:

<div><img onload="hidestuff('sched1'); hidestuff('sched2'); hidestuff('sched3');" src="/images/stories/calendar-ico.png" width="70px" border="0"/> Click on campus names to view schedules</div>

<img id='1reg' onclick="showstuff('sched1', '1reg', '1alt', 317);" width="389px" style="cursor: pointer;" src="/images/docs/scheduleparts/markhameast/olivetitle.jpg">
<img id='1alt' onclick="hidestuff('sched1', '1alt', '1reg';)" width="389px" style="cursor: pointer; display: none;" src="/images/docs/scheduleparts/markhameast/olivetitle.jpg">
<img id='sched1' width="389px" src="/images/docs/scheduleparts/markhameast/olivebody.jpg">

<img id='2reg' onclick="showstuff('sched2', '2reg', '2alt', 237);" width="389px" style="cursor: pointer;" src="/images/docs/scheduleparts/markhameast/libtitle.jpg">
<img id='2alt' onclick="hidestuff('sched2', '2alt', '2reg')" width="389px" style="cursor: pointer; display: none;" src="/images/docs/scheduleparts/markhameast/libtitle.jpg">
<img id='sched2' width="389px" src="/images/docs/scheduleparts/markhameast/libbody.jpg">

<img id='3reg' onclick="showstuff('sched3', '3reg', '3alt', 133);" width="389px" style="cursor: pointer;" src="/images/docs/scheduleparts/markhameast/centennialtitle.jpg">
<img id='3alt' onclick="hidestuff('sched3', '3alt', '3reg');" width="389px" style="cursor: pointer; display: none;" src="/images/docs/scheduleparts/markhameast/centennialbody.jpg">
<img onload="showstuff('sched1', '1reg', '1alt', 317)" id='sched3' width="389px" src="http://i.imgur.com/aBAtPM9.png">

我确信总的来说有更有效的方法来解决这个问题,但出于各种原因我需要保留这个方法。我的问题是,为什么我会收到语法错误?

非常感谢

你有一个错误的分号:

<img id='1alt' onclick="hidestuff('sched1', '1alt', '1reg';)" width="389px" style="cursor: pointer; display: none;" src="/images/docs/scheduleparts/markhameast/olivetitle.jpg">
                                                         ^^^^
                                                         HERE

它会在您的右括号之前提前终止您的语句。

<img id='1alt' onclick="hidestuff('sched1', '1alt', '1reg')" width="389px" style="cursor: pointer; display: none;" src="/images/docs/scheduleparts/markhameast/olivetitle.jpg">