
Originally Posted by
thewebiphyer
well I fixed the argument issue and it's still telling me there's an unexpected token in HTML document. I still don't understand why it would say there's a script error in an HTML document. Either way I did look through the rest of the code and could not find anything that may be causing it.

It may not be in the HTML document. It holds the call to the external JS source file and that is where I think the problem is.
It reports the error being found in the HTML.
One other thing to check.
Code:
//-------------------------GENERATE CHORD QUIZ --------------------
function chd_quiz(type) {
if (document.getElementById('sound1').innerHTML == ""){
s=1; trys = 1; score = 0; counter = 1;
while (s < 21){
document.getElementById("sound"+s).innerHTML="<input \
type='button' onclick='change_chdsource("+s+","+s+",'"+type+"')' value='Play Chord' \
id=\""+s+"\" /><form id=''><input type='text' id='ui"+s+"' /><br><br>\
.....
//-----------------------generate random chord sound -----------
function change_chdsource(ques_num,buttonid,type) {
//------------------------first click ---------------
if (counter==1){
if(type=="tri"){
var chdtype="tri", select_qual=chdfolder('tri'); select_file = find();
}
else if(type=="sev"){
var chdtype="sev", select_qual=chdfolder('sev'); select_file = find();
}
'type' is a reserved word in HTML and maybe JS.
You might try changing it to something else. A bit more descriptive as to its function maybe.
I don't know if that will fix it, but it's a start.
Check the error console if using FF or Chrome browsers for a report on fatal and non-fatal errors.
Bookmarks