Refresh Image every 10 seconds

Hello Guys,

How can refresh this link:

<a href="javascript:this.newWindow = window.open(https://secure.mywebsite.com/client2/rchat.asp?acct=45545454,'Trilogy','toolbar=no,location=no,directories=no,menubar=no,status=no,scrollbars=no,resizable=no,width=600,height=450,replace=no');this.newWindow.focus()"><img src="https://secure.mywebsite.com/image.asp?acct=45545454" name="Trilogy" border="0"></a>

Every 10 seconds (in the same line of code)?

Thanks.
pvg1975Asked:
Who is Participating?
I wear a lot of hats...

"The solutions and answers provided on Experts Exchange have been extremely helpful to me over the last few years. I wear a lot of hats - Developer, Database Administrator, Help Desk, etc., so I know a lot of things but not a lot about one thing. Experts Exchange gives me answers from people who do know a lot about one thing, in a easy to use platform." -Todd S.

RoonaanCommented:
<img id="myImageId" src="https://secure.mywebsite.com/image.asp?acct=45545454" name="Trilogy" border="0">

Then have

<script type="text/javascrïpt>"
  function reloadImage() {
     id = 'myImageId';
     im = document.getElementById(id);
     src = im.srcl
     im.src = '';
     im.src = src;
  }
</script>

<body onload="setInterval('reloadImage()', 10000);">

Not sure if you want to have added a random var?
pvg1975Author Commented:
Hello Ronnaan,

I am looking to put the script in the same line than the original one:

<a href="javascript:this.newWindow = window.open(https://secure.mywebsite.com/client2/rchat.asp?acct=45545454,'Trilogy','toolbar=no,location=no,directories=no,menubar=no,status=no,scrollbars=no,resizable=no,width=600,height=450,replace=no');this.newWindow.focus()"><img src="https://secure.mywebsite.com/image.asp?acct=45545454" name="Trilogy" border="0"></a>
RoonaanCommented:
<a href="javascript:this.newWindow = window.open(https://secure.mywebsite.com/client2/rchat.asp?acct=45545454,'Trilogy','toolbar=no,location=no,directories=no,menubar=no,status=no,scrollbars=no,resizable=no,width=600,height=450,replace=no');this.newWindow.focus()">
<img id="myImage" src="https://secure.mywebsite.com/image.asp?acct=45545454" name="Trilogy" border="0">
<script type="text/javascrïpt>"
  function reloadImage() {
     id = 'myImageId';
     im = document.getElementById(id);
     src = im.srcl
     im.src = '';
     im.src = src;
  }
  setInterval('reloadImage()', 10000);
</script>
</a>

-r-
OWASP: Threats Fundamentals

Learn the top ten threats that are present in modern web-application development and how to protect your business from them.

ZvonkoSystems architectCommented:
Refreshing the link does not make sense to me.
Perhaps refreshing the image in the link?
Like this:
<a href="javascript:this.newWindow = window.open(https://secure.mywebsite.com/client2/rchat.asp?acct=45545454,'Trilogy','width=600,height=450');this.newWindow.focus()"><img src="https://secure.mywebsite.com/image.asp?acct=45545454" name="Trilogy" border="0" onLoad="setTimeout('document.images.Trilogy.src+=\'#\'+(new Date()).getTime();',10000)"></a>




pvg1975Author Commented:
Hi Zvonko!

Yes, that's what I am looking for, but it didn't work (is not refreshing)
Hans LangerCommented:
its work perfect for me.. maybe this image dont exist and its never trigger onload event.

use
onerror="setTimeout('document.images.Trilogy.src+=\'#\'+(new Date()).getTime();',10000)"

like this:

<a href="javascript:this.newWindow = window.open(https://secure.mywebsite.com/client2/rchat.asp?acct=45545454,'Trilogy','width=600,height=450');this.newWindow.focus()"><img src="https://secure.mywebsite.com/image.asp?acct=45545454" name="Trilogy" border="0" onLoad="setTimeout('document.images.Trilogy.src+=\'#\'+(new Date()).getTime();',10000)" onerror="setTimeout('document.images.Trilogy.src+=\'#\'+(new Date()).getTime();',10000)"></a>

Experts Exchange Solution brought to you by

Your issues matter to us.

Facing a tech roadblock? Get the help and guidance you need from experienced professionals who care. Ask your question anytime, anywhere, with no hassle.

Start your 7-day free trial
It's more than this solution.Get answers and train to solve all your tech problems - anytime, anywhere.Try it for free Edge Out The Competitionfor your dream job with proven skills and certifications.Get started today Stand Outas the employee with proven skills.Start learning today for free Move Your Career Forwardwith certification training in the latest technologies.Start your trial today
JavaScript

From novice to tech pro — start learning today.