Links

Lists

Latest Updates

Ruby On Rails List
Python list
Advanced Java
The JavaScript List
Apache Users
Full Disclosure
Linux Security

Search the archives!


[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[Javascript] Refreshing only one image


  • From: javascript@xxxxxxxxxx (Diego Bustamante)
  • Subject: [Javascript] Refreshing only one image
  • Date: Thu, 18 Oct 2001 18:39:57 -0300

This is a multi-part message in MIME format.

------=_NextPart_000_000F_01C15804.493925C0
Content-Type: text/plain;
	charset="iso-8859-2"
Content-Transfer-Encoding: quoted-printable

in Explorer 4  you can do this:

//On init
handle =3D window.event.setInterval(  "myFunction", 500 ); //(in =
miliseconds)
.
.
.
.

//On finish
window.event.clearInterval( handle );

function myFunction(){
    var img =3D document.getElementByID( 'myImage_ID'  );
    .
    .
    .
    .
    img.src =3D 'new_src';
}

I hope this can help you.
Diego Bustamante.

  ----- Original Message -----=20
  From: Iztok Polanic=20
  To: javascript@xxxxxxxxxx=20
  Sent: Thursday, October 18, 2001 12:17 PM
  Subject: [Javascript] Refreshing only one image


  Hi!

  I have a page which has one image. Now I want to make a function that =
will change the image  every 5 minutes. But I don't want to =
refresh/reload the whole page only the image should change. Does anybody =
have an idea how to make this?

  Bye,

  Iztok

------=_NextPart_000_000F_01C15804.493925C0
Content-Type: text/html;
	charset="iso-8859-2"
Content-Transfer-Encoding: quoted-printable

<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0 Transitional//EN">
<HTML><HEAD>
<META http-equiv=3DContent-Type content=3D"text/html; =
charset=3Diso-8859-2">
<META content=3D"MSHTML 6.00.2462.0" name=3DGENERATOR>
<STYLE></STYLE>
</HEAD>
<BODY bgColor=3D#ffffff>
<DIV><FONT face=3DArial size=3D2>in Explorer 4&nbsp;&nbsp;you can do=20
this:</FONT></DIV>
<DIV><FONT face=3DArial size=3D2></FONT>&nbsp;</DIV>
<DIV><FONT face=3DArial size=3D2>//On init</FONT></DIV>
<DIV><FONT face=3DArial size=3D2>handle =3D =
window.event.setInterval(&nbsp;=20
"myFunction",&nbsp;500&nbsp;); //(in miliseconds)</FONT></DIV>
<DIV><FONT face=3DArial size=3D2>.</FONT></DIV>
<DIV><FONT face=3DArial size=3D2>.</FONT></DIV>
<DIV><FONT face=3DArial size=3D2>.</FONT></DIV>
<DIV><FONT face=3DArial size=3D2>.</FONT></DIV>
<DIV><FONT face=3DArial size=3D2></FONT>&nbsp;</DIV>
<DIV><FONT face=3DArial size=3D2>//On finish</FONT></DIV>
<DIV><FONT face=3DArial size=3D2>window.event.clearInterval( handle =
);</FONT></DIV>
<DIV><FONT face=3DArial size=3D2></FONT>&nbsp;</DIV>
<DIV><FONT face=3DArial size=3D2>function myFunction(){</FONT></DIV>
<DIV><FONT face=3DArial size=3D2>&nbsp;&nbsp;&nbsp;&nbsp;var img =3D=20
document.getElementByID( 'myImage_ID' &nbsp;);</FONT></DIV>
<DIV><FONT face=3DArial size=3D2>&nbsp;&nbsp;&nbsp; .</FONT></DIV>
<DIV><FONT face=3DArial size=3D2>&nbsp;&nbsp;&nbsp; .</FONT></DIV>
<DIV><FONT face=3DArial size=3D2>&nbsp;&nbsp;&nbsp; .</FONT></DIV>
<DIV><FONT face=3DArial size=3D2>&nbsp;&nbsp;&nbsp; .</FONT></DIV>
<DIV><FONT face=3DArial size=3D2>&nbsp;&nbsp;&nbsp; img.src =3D=20
'new_src';</FONT></DIV>
<DIV><FONT face=3DArial size=3D2>}</FONT></DIV>
<DIV><FONT face=3DArial size=3D2></FONT>&nbsp;</DIV>
<DIV><FONT face=3DArial size=3D2>I hope this can help you.</FONT></DIV>
<DIV><FONT face=3DArial size=3D2>Diego Bustamante.</FONT></DIV>
<DIV><FONT face=3DArial size=3D2></FONT>&nbsp;</DIV>
<BLOCKQUOTE dir=3Dltr=20
style=3D"PADDING-RIGHT: 0px; PADDING-LEFT: 5px; MARGIN-LEFT: 5px; =
BORDER-LEFT: #000000 2px solid; MARGIN-RIGHT: 0px">
  <DIV style=3D"FONT: 10pt arial">----- Original Message ----- </DIV>
  <DIV=20
  style=3D"BACKGROUND: #e4e4e4; FONT: 10pt arial; font-color: =
black"><B>From:</B>=20
  <A title=3Diztokp@xxxxxxxx href=3D"mailto:iztokp@xxxxxxxx";>Iztok =
Polanic</A>=20
</DIV>
  <DIV style=3D"FONT: 10pt arial"><B>To:</B> <A =
title=3Djavascript@xxxxxxxxxx=20
  href=3D"mailto:javascript@xxxxxxxxxx";>javascript@xxxxxxxxxx</A> </DIV>
  <DIV style=3D"FONT: 10pt arial"><B>Sent:</B> Thursday, October 18, =
2001 12:17=20
  PM</DIV>
  <DIV style=3D"FONT: 10pt arial"><B>Subject:</B> [Javascript] =
Refreshing only one=20
  image</DIV>
  <DIV><BR></DIV>
  <DIV><FONT face=3DArial size=3D2>Hi!</FONT></DIV>
  <DIV><FONT face=3DArial size=3D2></FONT>&nbsp;</DIV>
  <DIV><FONT face=3DArial size=3D2>I have a page which has one image. =
Now I want to=20
  make a function that will change the image&nbsp; every 5 minutes. But =
I don't=20
  want to refresh/reload the whole page only the image should change. =
Does=20
  anybody have an idea how to make this?</FONT></DIV>
  <DIV><FONT face=3DArial size=3D2></FONT>&nbsp;</DIV>
  <DIV><FONT face=3DArial size=3D2>Bye,</FONT></DIV>
  <DIV><FONT face=3DArial size=3D2></FONT>&nbsp;</DIV>
  <DIV><FONT face=3DArial =
size=3D2>Iztok</FONT></DIV></BLOCKQUOTE></BODY></HTML>

------=_NextPart_000_000F_01C15804.493925C0--