Tgawe
10-08-2011, 10:28 PM
<body>
<center>
<script type="text/javascript">
var imageSrc = ['<img www.mysite.com/subfolder/001.jpg></img>','002.jpg','003.jpg',
'004.jpg','005.jpg','006.jpg'];
var imageSrc2 = [];;
function copyRandom(){
if (0 == imageSrc2.length) {
imageSrc2 = imageSrc.concat();
}
var randNum = (Math.random()*imageSrc2.length) | 0;
return imageSrc2.splice(randNum, 1);
}
</script>
<!-- <button
onclick="document.getElementById('xx').innerHTML = (copyRandom());"> -->
<button
onclick="document.getElementById('xx').innerHTML = (copyRandom());">
Draw A Card
</button>
<div id="xx"></div>
<!-- <div id="xx"></div> -->
</center>
</body>
Why are my images broken in this script? Specifically "<img www.mysite.com/subfolder/001.jpg></img>" as the rest are just placeholders until I solve the first one.
<center>
<script type="text/javascript">
var imageSrc = ['<img www.mysite.com/subfolder/001.jpg></img>','002.jpg','003.jpg',
'004.jpg','005.jpg','006.jpg'];
var imageSrc2 = [];;
function copyRandom(){
if (0 == imageSrc2.length) {
imageSrc2 = imageSrc.concat();
}
var randNum = (Math.random()*imageSrc2.length) | 0;
return imageSrc2.splice(randNum, 1);
}
</script>
<!-- <button
onclick="document.getElementById('xx').innerHTML = (copyRandom());"> -->
<button
onclick="document.getElementById('xx').innerHTML = (copyRandom());">
Draw A Card
</button>
<div id="xx"></div>
<!-- <div id="xx"></div> -->
</center>
</body>
Why are my images broken in this script? Specifically "<img www.mysite.com/subfolder/001.jpg></img>" as the rest are just placeholders until I solve the first one.