joeblack9988 / slideshow

Automatically exported from code.google.com/p/slideshow
0 stars 0 forks source link

Uncaught ReferenceError: Class is not defined #160

Closed GoogleCodeExporter closed 8 years ago

GoogleCodeExporter commented 8 years ago
Hey, I have some problem displaying correctly the slideshow. I'm trying to 
display the demo version on my website getting the images from an ajax query.
The problem is that when I try to show the slideshow, the Chrome JS inspector 
tells me there is this Uncaught ReferenceError about "Class is not defined". I 
believe Class is something related to mootools. Both mootools and slideshow 
JS's are imported correctly (no import errors).
I'm using the last version of Chrome, but I believe it doesn't matter since the 
demo version on my machine was working, while the pretty much same exact code 
isn't online on my website. I've also tried with FireFox, but nothing is shown. 
The ajax query returns correct values to feed the slideshow.

Maybe there is some conflicts with other JS libraries? I'm also using JQuery, 
maybe it's its fault.
Let me know, thanks in advance.

Original issue reported on code.google.com by masiar88@gmail.com on 1 Feb 2011 at 12:10

GoogleCodeExporter commented 8 years ago
http://docs.jquery.com/Using_jQuery_with_Other_Libraries

Original comment by aeron.gl...@gmail.com on 1 Feb 2011 at 12:33

GoogleCodeExporter commented 8 years ago
Well thanks, but that doesn't work either.
Here is the actual function:

function fillSlideshow(placeId){
    jQuery.noConflict();
    var urlFile = "someurl.php";
        jQuery.ajax({
            type: "POST",
            url: urlFile,
            async:false,
            data: "imagePlaceId="+placeId,
            success: function(msg){
                    alert(msg);

                    var imagesarray = eval("(" + msg + ")");

                    window.addEvent('domready', function(){
                        var data = imagesarray;
                        var myShow = new Slideshow('show', data, {controller: false, height: 300, hu: 'images/', thumbnails: true, width: 400});
                    });
                }
        });
}

The funny thing is that if I comment out everything in the success function it 
doesn't have the error, while if I only let the alert fire, then even if 
everything else in success is commented, the error about the class is raised. 
Any thoughts?
Ah by the way, I know eval is not secure at all, I'm just lazy.

Original comment by masiar88@gmail.com on 1 Feb 2011 at 1:26

GoogleCodeExporter commented 8 years ago
Ah, I forgot to mention the entire website is based on Google Maps, and I also 
use some ajax uploader thingy, don't know if that could have some sort of 
conflict though.

Original comment by masiar88@gmail.com on 1 Feb 2011 at 1:32

GoogleCodeExporter commented 8 years ago
No idea. But why not just use Mootools AJAX methods?

Original comment by aeron.gl...@gmail.com on 1 Feb 2011 at 1:33

GoogleCodeExporter commented 8 years ago
Also - if it's public - just post a link to the website on the Slideshow Google 
Group.

This is troubleshooting, not an issue with Slideshow script itself....

Original comment by aeron.gl...@gmail.com on 1 Feb 2011 at 1:35