01-10-2003, 09:30 PM
Hi, I'm trying to find these JavaScrips, but it's harder then I thought. :(
Appreciate it if anyone in here could point me thorward two JavaScrips wich does something like this:
Mask the url address (from http://www.telia.se/~4024024024 to just http://www.simple.org)
Reloading an image, just the image, not the hole page. (the script should allow me to determain patch to the image, and delay on when it should reload)
Anyone who answers this and by some mean can help me out, BIG thanks! :thumbsup:
Love ya :D
01-10-2003, 09:51 PM
About your images reloading? Hmmm, this should work...function reloadImage( time, imgId )
setTimeout( "document.images[imgId].src = document.images[imgId].src", time );
01-10-2003, 10:29 PM
I wrote this
function reloadImage( 5000, http://18.104.22.168:80/cam.jpg )
document.images[http://22.214.171.124:80/cam.jpg].src", 5000 );
My image's located over at http://126.96.36.199:80/cam.jpg
...nothing showed, I'm pretty sure I did something wrong.
Anyone correct this for me, caus I don't know how too.
01-10-2003, 10:38 PM
You've got the wrong idea.<html>
function reloadImage( time, imgId )
setInterval( "document.images[imgId].src = document.images[imgId].src", time );
<body onload="reloadImage( 5000, 'camPic' );">
<img src="http://188.8.131.52:80/cam.jpg" id="camPic">
</html>This will refresh the image EVERY five seconds.
01-10-2003, 11:00 PM
So far so good.
The image appears.
But only once.
The page tries to reload after 5 secounds, but then, down there on the IE status bar, it says something like "Error on page" and the same picture's shown.
It'll reload tho normal when I push the regulair reload-button.
Seems good this far, now, on how to fix that... does it work ok for you? You can see my test-page over at here (http://home.no/philipshemsida/TEST.html) and tell me how it went.
Thanks dude for your help by the way, very appreciated. :thumbsup:
01-10-2003, 11:08 PM
Sorry, I forgot those intervals need global variables...function reloadImage( time, imgId )
window.myImage = document.images[imgId];
setInterval( "myImage.src = myImage.src", time );
01-10-2003, 11:50 PM
Seems to be running fine now... I'll just implant it into my homepage and we'll see soon...
01-11-2003, 01:33 AM
The code worked perfectly.
Thank you beetle very much, you've been to great help.