webForumDet fria alternativet

Javascriptfel i slideshow

2 svar · 325 visningar · startad av saw

sawMedlem sedan mars 20011 880 inlägg
#1

Jag försöker att lägga in en slideshow. Orginalet(som jag hittade på internet)
fungerade perfekt, men den var gjort utan masterpage(om det nu har någon
betydelse), men jag har masterpage.
Felet uppkommer när nästa bild skall visas:

var c_interval = 5000;
        window.setTimeout("getNextImage()", c_interval);
        
        function getNextImage()
        {
            //Send the request to server with the current image url as the argument
            CallServer(document.getElementById("photo").src, "");
        }
                  
        function ReceiveServerData(rValue)
        {
            //Receive server's response of a string rValue, which is prepared in 
the server's function
            //GetCallbackResult()
            var wds = rValue.split(";");
            //Assign the transition effect
            document.getElementById("photo").style.filter = wds[1];
            //Preload the image file from server.  When finishing download, 
imageLoaded function will be called
            //with the img object as the argument                           
            var img  = new Image();
            img.onload = function(){ imageLoaded(this); }
            img.onerror = function(){ imageError(this); }
            img.onabort = function(){ imageError(this); }
            img.src = wds[0];                                            
        }
        function imageError(img)
        {
            //If image download errors occur, this function will be called.
            window.setTimeout("getNextImage()", 1000);
        }
        function imageLoaded(img)
        {
            var photo = document.getElementById("photo");  
 //Find the image control object
            photo.filters[0].apply();                       
//Apply the transition effect
            photo.filters[0].play();                        
//Play the effect and display the new image
            photo.src = img.src;                            
//Assign the image to the image control
            window.setTimeout("getNextImage()", c_interval);
//Initiate the next request
        }

Error:

Rad: 18
Tecken: 13
Fel: object krävs
Kod: 0
Url: http://localhost:3195/willyes/

Jag skickade bara med javascriptet här jag tror inte att de andra behövs.
Scriptet ligger i headern i masterpagen.
Några förslag?

yadorMedlem sedan mars 2004455 inlägg
#2

Du måste byta ut localhost i url:en mot ditt ip om du vill att vi ska kunna besöka sidan som du länkar till.

sawMedlem sedan mars 20011 880 inlägg
#3

Jag vill inte länka till något, som du ser så var det error!

126 ms totalt · 3 externa anrop · v20260731065814-full.3ab8d573
0 ms — hämta forumlista (cache)
0 ms — hämta statistik (cache)
123 ms — hämta tråd, inlägg och bilagor (db)