Hey I'm trying to get this lightbox script to work on a client site but I get this error '$ is not defined', I'm not well with JS so i was wondering if i could get开发者_StackOverflow社区 some help, heres the site - http://www.petconnection.com/blog/.
Thanks, Antonio.
Here's the problem:
/res/javascript/lightbox/jquery.lightbox-0.5.js
Failed to load resource: the server responded with a status of 404 (Not Found)
/res/javascript/jquery/jquery-1.4.2.min.js
Failed to load resource: the server responded with a status of 404 (Not Found)
The page is trying to retrieve the JavaScript file that defines jQuery (hence $
) but the server is replying with a 404 error. Either it's requesting the wrong URL, or the file has been deleted from the server — perhaps replaced by a new version of jQuery (1.4.2 is pretty old at this point, we're on to 1.5).
The order of those messages also indicates that you're (trying to) load the the lightbox script before the jQuery script. This is bad juju. Lightbox depends on jQuery, so you've got to load jQuery first.
Antonio, it doesn't look like either of your scripts are loading properly. Try linking directly (instead of relative links) or just double check the links you currently have.
精彩评论