Link to home
Start Free TrialLog in
Avatar of pvg1975
pvg1975Flag for Argentina

asked on

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.
Avatar of Roonaan
Roonaan
Flag of Netherlands image

<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?
Avatar of pvg1975

ASKER

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>
<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-
SOLUTION
Avatar of Zvonko
Zvonko
Flag of North Macedonia image

Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial
Avatar of pvg1975

ASKER

Hi Zvonko!

Yes, that's what I am looking for, but it didn't work (is not refreshing)
ASKER CERTIFIED SOLUTION
Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial