Question

Solved

With the amount of information I provided this was unsolvable. A PHP library that I'm using was also including jQuery, resulting in double inclusion and prettyPhoto going berzerk.

The problem

This is starting to drive me crazy. I've included jQuery 1.7, prettyPhoto 3.1 and my own JS file:

<script src="/files/js/jquery-1.7.min.js" type="text/javascript" charset="utf-8"></script>
<script src="/files/js/jquery.prettyPhoto.js" type="text/javascript" charset="utf-8"></script>
<script src="/m/js/jzg.js?cache=no" type="text/javascript" charset="utf-8"></script>

No errors appear in the console, unless I try to use prettyPhoto - then I get the $("mySelectorGoesHere").prettyPhoto is not a function error.

In FireBug console jQuery.prettyPhoto and $.prettyPhoto both show up as undefined.

I can inspect the header of the page to see that the script tags show proper content of the included files. The same is seen in the Network tab - files seem to get loaded OK.

I've tried appending an alert to jquery.prettyPhoto.js and on page load the alert fires up, but prettyPhoto itself still is undefined.

One more thing I tried was to download the latest versions of prettyPhoto (3.1.3) and jQuery (1.7.1) and replace the ones I was using - to no effect.

What am I missing?

Was it helpful?

Solution

With the amount of information I provided this was unsolvable. A PHP library that I'm using was also including jQuery, resulting in double inclusion and prettyPhoto going berzerk.

Licensed under: CC-BY-SA with attribution
Not affiliated with StackOverflow
scroll top