-
Notifications
You must be signed in to change notification settings - Fork 108
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
$case is not defined #12
Comments
Did you ensure that you call lightcase only after the whole DOM is loaded? Sounds like you have included all javascript sources within the head tag but the function call not beeing executed when document is ready and jQuery(document).ready(function ($) {
$('a[data-rel^=lightcase]).lightcase();
}); or alternatively: (function ($) {
$(function () {
$('a[data-rel^=lightcase]).lightcase();
});
})(jQuery); |
I've called lightcase within the document ready function, I've also called it with (window).load, so it definitely is getting loaded after dom is loaded. And, like I said, all my other jquery functions work within that same document ready block. I've also isolated it so just lightcase is loading, and nothing. This is the weirdest thing, b/c I have used lightcase on literally dozens of other projects without any issues. I even tried going back to previous versions, but I get the same problem. I'm using jquery 1.10.2. |
I figured it out. This is bizarre. My lightcase stylesheet had an id on it, like this: Removing the id="lightcase-css" makes it work. Keeping the id on there causes the "$case is not defined" error. What would cause this? UPDATE: changing the id to something different does not cause the same problem. So, that specific ID is causing problems. |
I figured out that this line is producing the error. This wildcard selector seems to be a bit too generic, obviously. It checks if the neccessary markup is already added or not and will not do the call Thanks for your feedback about this issue and let's keep the status open. |
Glad to have helped. I thought I was going crazy for a while. |
When clicking a lightcase link, I get "Uncaught ReferenceError: $case is not defined"
jQuery is present, and all other jQuery functions and plugins work. I've tried isolating just lightcase, with same result.
I'll try duplicating on another site, but this one has me stumped.
UPDATE: I've isolated the page so it's just got jquery 1.10.2 and lightcase. Same issue.
My function call looks like this:
$('a[data-rel^=lightcase]').lightcase();
The text was updated successfully, but these errors were encountered: