Please check the HTML troubleshooting guide here https://itch.io/docs/creators/html5#common-pitfalls
The answer to your issue is likely there.
Please check the HTML troubleshooting guide here https://itch.io/docs/creators/html5#common-pitfalls
The answer to your issue is likely there.
Thanks! - I have been through the list and I don't think it's any of those?
I just tried starting from scratch, creating a JS file in a text editor, but I'm still having the same issue. It works locally but not when I upload it.
I've also temporarily set it to download the zip file instead, so at least it's not showing the broken link.
The contents of index.html is this (except with 55 images, not just 6):
<html>
<head>
<SCRIPT LANGUAGE="JavaScript">
<!-- Begin
var theImages = new Array()
theImages[0] = 'Slide1.jpg'
theImages[1] = 'Slide2.jpg'
theImages[2] = 'Slide3.jpg'
theImages[3] = 'Slide4.jpg'
theImages[4] = 'Slide5.jpg'
theImages[5] = 'Slide6.jpg'
var j = 0
var p = theImages.length;
var preBuffer = new Array()
for (i = 0; i < p; i++){
preBuffer[i] = new Image()
preBuffer[i].src = theImages[i]
}
var whichImage = Math.round(Math.random()*(p-1));
function showImage(){
document.write('<img src="'+theImages[whichImage]+'" width="540" height="720">');
}
// End -->
</script>
</head>
<body>
<input type="button" value="Draw Again" onClick="window.location.reload(true)">
<br/>
<script language="JavaScript">
<!-- Begin
showImage();
// End -->
</script>
</body>
</html>
I’m sorry but we can’t troubleshoot your code, that’s your responsibility! The issue is likely because you are using incorrect case when trying to load the file, as described in the troubleshooting guide I linked. Please ensure you match the upper/lower case of all letters when referencing a file.
If you have found a solution to your problem then I also recommend posting that here so others who may have a similar issue can be helped in the finding a solution.