switch statement - My Javascript doesn't work -
i wrote simple program following example book. it's supposed draw dice random number of dots doesn't work. found problem caused simple "switch" instruction.
thing downloaded program author's page , work. after slight adjustment in formatting code identical it's still broken.
it nice if tell me if going on.
this how code looks (and doesn't work): http://pastebin.com/1hjwpxi8
this author's: http://faculty.purchase.edu/jeanine.meyer/html5/dice1.html
i found if copy/paste "switch" instruction author's code mine starts working properly.
problem here:
case 5; draw4(); draw1(); break; case 6; draw4(); draw2mid(); break;
cases in switch statement followed colon, not semi-colon. replace case 5;
case 5:
, case 6;
case 6:
...
and code work.
Comments
Post a Comment