HTML Tutorial


 Forum HomeForum Home   FAQFAQ   SearchSearch   MemberlistMemberlist   RegisterRegister 
 ProfileProfile   Log in to check your private messagesLog in to check your private messages   Log inLog in 
RegisterRegister - Not registered yet? Got something to say? Join HTML Code Tutorial!
debugging errors
Post new topic   Reply to topic    HTML Help Forum Index -> Javascript
View previous topic :: View next topic  
Author Message
quartzy



Joined: 26 Dec 2007
Posts: 405

PostPosted: Tue Mar 11, 2008 3:19 am     debugging errors Reply with quote

I have downloaded a script in order to show a mini slideshow of images, but the thing keeps throwing up debugging errors and I have not got a clue, can anyone tell me what is wrong with it?

Code:
<table><tr><td width="100%"><img src="bigimages/goldfishbelow.jpg" width="500" height="375" name="photoslider"></td></tr>
  <tr><td width="100%"><form method="POST" name="rotater"><div align="center"><center><p>

<script language="JavaScript1.1">

/*
Photo Slider II- By Kevin Adams (kadamsatkyk.net)
For this script and more
Visit http://www.javascriptkit.com
*/

var photos=new Array()
var text=new Array()
var which=0
var what=0

//Change the below variables to reference your own images. You may have as many images in the slider as you wish
photos[0]="bigimages/goldfishbelow.jpg"
photos[1]="plane2.gif"
photos[2]="plane3.gif"
photos[3]="plane4.gif"
photos[4]="plane5.gif"

//change coresponding description
text[0]="B2 Stealth Bomber"
text[1]="F15 Tom Cat!"
text[2]="Russian Su27 Fighter Jet"
text[3]="Some training jet."
text[4]="Commerical Airliner"


window.onload=new Function("document.rotater.description.value=text[0]")

function backward(){
if (which>0){
window.status=''
which--
document.images.photoslider.src=photos[which];
what--
document.rotater.description.value=text[what];
}
}

function forward(){
if (which<photos.length-1){
which++
document.images.photoslider.src=photos[which]
what++
document.rotater.description.value=text[what];
}
else window.status='End of gallery'
}
}
function type()
alert("This textbox will only display default comments")a
   }
   }


</script>
<p><input type=text name="description" style="width:450px" size=50>

<p><input type="button" value="Back" name="B2"
      onClick="backward()"> <input type="button" value="Next" name="B1"
      onClick="forward()"><br />
      <a href="#" onClick="which=1;what=1;backward();return false">Start Over</a></p>
      </center></div>
    </form>
    </td>
  </tr>
</table>



I have only added one picture the other images are the test for this script.
quartzy



Joined: 26 Dec 2007
Posts: 405

PostPosted: Tue Mar 11, 2008 3:20 am     re Reply with quote

It does not seem to like the code in between these lines.

Code:
function forward(){
if (which<photos.length-1){
which++
document.images.photoslider.src=photos[which]
what++
document.rotater.description.value=text[what];
}
else window.status='End of gallery'
}
}
function type()
alert("This textbox will only display default comments")a
   }
   }

Display posts from previous:   
Post new topic   Reply to topic    HTML Help Forum Index -> Javascript All times are GMT - 8 Hours
Page 1 of 1

 
Jump to:  
You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot vote in polls in this forum
HTML Help Archive
Powered by phpBB © 2001, 2005 phpBB Group
HTML Help topic RSS feed 

 
HOSTING / DESIGN
MAKE MONEY

Home
  |   Tutorials   |   Forum   |   Quick List   |   Link Directory   |   About
Copyright ©1997-2002 Idocs and ©2002-2007 HTML Code Tutorial