I've been playing around with this a bit, and have tried using arrays - now I can get something to appear in the div, but it looks like this:
�V��$��F��Ⱦ36�H�W���/+�N�FC�C
b8͔��@�5^��
etc... so I assume it is pulling it up in the wrong format or something? Also, the image isn't changing, it only changes when I refresh the page - am I not calling the function back correctly?
Any help on how to correct this would be much appreciated, thanks!!
New code:
- <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN"
"http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd">
<html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en" lang="en">
<head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
<title></title>
<script>
function randomImage(){
var images=new Array()
images[1]="images/101.jpg"
images[2]="images/102.jpg"
images[3]="images/103.jpg"
images[4]="images/104.jpg"
images[5]="images/105.jpg"
images[6]="images/106.jpg"
images[7]="images/107.jpg"
images[8]="images/108.jpg"
images[9]="images/109.jpg"
images[10]="images/110.jpg"
images[11]="images/111.jpg"
images[12]="images/112.jpg"
images[13]="images/113.jpg"
images[14]="images/114.jpg"
images[15]="images/115.jpg"
images[16]="images/116.jpg"
images[17]="images/117.jpg"
images[18]="images/118.jpg"
images[19]="images/119.jpg"
images[20]="images/120.jpg"
for (i = 0; i < 1; i++) {
var ranPic=Math.floor(Math.random()*images.length)
if (ranPic==0)
ranPic=1
$("#words").fadeOut('300',function(){
$("#words").load(images[ranPic], function(){
$("#words").fadeIn('400');
})})
}
}
randomImage()
</script>
</head>
<body>
<div id="words"></div>
</body>
</html>