Forum Moderators: open
function module(modId,code,modName,course,modDir,examDir, num) {
this.modId = modId;
this.code = code;
this.modName = modName;
this.course = course;
this.modDir = modDir;
this.examDir = examDir;
this.num = num;
this.printModule = printModule;
this.printExam = printExam;
}
I have got a problem with the for loop above. the page displays fine enough but heres the problem. if this.num = 2, it should display two hyperlinks. if this.num = 1, it would display one hyperlink etc.
when this.num = 1, it displays one link fine but when it is greater than 1, it can not seem to display more than one link.
what is wrong with the loop or coding? this Javascript code is driving me mad!
I'm guessing this:
line7 += '<a href="www.google.com/' + this.modId + "/" + this.examDir
Currently each iteration is overwriting the last one, this will concatenate it. :-)
EDIT: I bolded the += but it's not taking, note I've added a + before the =.