I have some simple javascript code that looks like this:
var divLink = $(this).attr("href");
alert(divLink);
if ($(divlink).is(":visible")) $(divLink).hide("blind", { direction: "vertical" }, 1000);
It throws this error on line 3:
Uncaught ReferenceError: divlink is not defined
I put in line two just to see what was in the variable divLink. It returns:
The page at mysite.com says:
#categories_settings
Once I click “OK” on the dialog box, it throws the error. How can this be?
JS is case-sensitive. Use
divLinkconsistently, and notdivlink.That resolves the reference error. @epascarello’s answer solves other issues.