I used to have a lot of things inside my click function. Now, I tried to refactor my code, by creating a function and call it back,that way I can re-use it in more than one places without repeating myself.
I'm a lil stuck now, and not sure what I did wrong here. I got 0 error and 0 warning on my .js file. I use JS lint.
Here is what I have at the moment.
function cbInit() {
($pbSection, $chSection, $chBtns, $chBtnsRow, $btnTime, $btnRemediation).hide();
($cbSection, $cbBtns).show();
$btnBiDefault.removeClass('btn-bi-default-clicked');
$btnAssignmentPerformance.addClass('btn-bi-default-clicked');
$cbImage.attr('src', '/BIM/resources/images/monitorprogress/reports/02-Course Benchmark/Assignment.png');
}
$courseBenchmark.click(function(e) {
e.preventDefault();
cbInit();
}
Nothing got hide, no image loaded.
It seems like cbInit();
never get execute at all.
- How to trace down this kind of problem ?
- Can someone help give me a little help here ?