Apologies for the newbie question, but I'm trying to display a gif on a webpage using an HTTP link and it works perfectly. However, when I try to replace it with a file path, it doesn't work.
The gif is located in the same folder as the webpage.
I've tried the following:
- /thegifname.gif
- ./thegifname.gif
- //thegifname.gif
- thegifname.gif
None of these options seem to work. When I use the debugger in Internet Explorer and set a breakpoint in the code with the local path ./thegifname.gif, it does work! But without the debugging tool, I can't see the gif.
<script language="javascript" type="text/javascript">
var size = 0;
var id= 0;
function add_gif() {
document.getElementById("Label1").style.display = "none";
show_image("http://i789.photobucket.com/albums/yy180/Lendisson/progress_bar.gif", 300,15, "Running");
}
function show_image(src, width, height, alt) {
var img = document.createElement("img");
img.src = src;
img.width = width;
img.height = height;
img.alt = alt;
document.getElementById("divUpload").style.display="inline";
var div = document.getElementById("divUpload");
div.appendChild(img);
}
</script>