Hi folks,
I think I'm fundamentally misunderstanding either JavaScript or jQuery .click handlers? I had assumed the function assigned to the click event could only see global variables and those inside the function. However it appears to be able to see those around it when the event is created?
I have
I wouldn't have expected courseID and assessmentID to be available inside the click function, however this is not the case.
- function addAssessmentClick(courseID, assessmentID) {
- jQuery("#assessment" + assessmentID).click(function() {
- console.debug("clicked courseID:"+courseID+" assessmentID:"+assessmentID);
Any thoughts?
Cheers!
Paul.