Jump to content



Welcome to KnowledgeSutra - Dear Guest , Please Register here to get Your own website. - Ask a Question / Express Opinion / Reply w/o Sign-Up!
- - - - -

Image Refresh


15 replies to this topic

#1 kvarnerexpress

    Super Member

  • Kontributors
  • PipPipPipPipPipPipPipPipPip
  • 407 posts

Posted 21 April 2005 - 08:57 PM

Hi all,
Does anyone know if there is any way to refresh only an image in a webpage? I can't use the meta refresh because that would defeat the purpose of this page. If a link to this page is needed to see what I mean, let me know. I am using layers and they are dragable by visitors and if I refresh the whole page, the layers get reset.
kvarnerexpress

#2 sunster13

    Advanced Member

  • Kontributors
  • PipPipPipPipPipPipPip
  • 125 posts

Posted 21 April 2005 - 11:13 PM

I don't fully understand what you mean, and a link would help.

But if you go to www.java.internet.com they have some good scripts and you will probably find the solution there.

#3 sunster13

    Advanced Member

  • Kontributors
  • PipPipPipPipPipPipPip
  • 125 posts

Posted 21 April 2005 - 11:14 PM

o srry it's http://javascript.internet.com/

srry bout that

#4 round

    Super Member

  • Kontributors
  • PipPipPipPipPipPipPipPipPip
  • 463 posts

Posted 22 April 2005 - 02:13 PM

i'm not sure what it is that your really trying to do, but from what i'm getting is that your looking for, or should be looking at an image rotation. I don't think there's a way of refreshing just one image on a page through js. Maybe you could do it with php.
round

#5 mizako

    Super Member

  • Kontributors
  • PipPipPipPipPipPipPipPipPip
  • 372 posts
  • Location:Spain
  • Interests:Computers, Usability, Internet, Web development, programming languages, soccer

Posted 22 April 2005 - 06:09 PM

kvarnerexpress, on Apr 21 2005, 08:57 PM, said:

Hi all,
Does anyone know if there is any way to refresh only an image in a webpage? I can't use the meta refresh because that would defeat the purpose of this page. If a link to this page is needed to see what I mean, let me know. I am using layers and they are dragable by visitors and if I refresh the whole page, the layers get reset.
kvarnerexpress

View Post


What do you mean with refresh an image?. Change the image for another one, for example when the user clicks a link? If it is that it can be done with Javascript?
Please, explain more detailed what it is exactlz what you want to do and maybe post a link.

#6 serverph

    Ancient Enigma

  • [MODERATOR]
  • PipPipPipPipPipPipPipPipPipPipPipPipPipPip
  • 1,952 posts
  • Gender:Male
  • Location:under the stars
  • Interests:http://kapamilyatalk.com<br />http://scq.serverph.uni.cc<br />http://reseller.premium.ws<br /><br />trap17 IP to access cpanel: https://64.69.46.210:2083/<br />alternative to access cpanel: gamma.xisto.com/~cpanelusername<br />Get your T17 banners here: http://www.trap17.com/banners/<br />TRAP17 Forum Search plugin: http://plugins.astahost.com/<br /><br />[url=http://reseller.premium.ws][img]http://img40.echo.cx/img40/2713/resellerfree4rd.png[/img][/url] |
  • myCENT:67.66

Posted 22 April 2005 - 06:33 PM

check this out: http://automaticlabs...roducts/rotator
related trap17 topic: http://www.trap17.co...ogos-t2724.html

i used that php rotator code in my site before, but since my site became popular (relatively :)) and gained unexpected traffic, i took it off my site since it has been eating on my bandwidth. :P nevertheless, it's a good script if that is what you are looking for. :lol: otherwise, maybe try explaining a bit more so we can be certain of what you actually require for your site.

#7 iGuest

    Hail Caesar!

  • Kontributors
  • PipPipPipPipPipPipPipPipPipPipPipPipPipPipPipPipPipPipPipPipPip
  • 5,876 posts
  • Interests:Trap17 Free Web Hosting, No Ads

Posted 09 October 2007 - 01:06 AM

SetInterval('reloadImage()', 30000); // 30 seconds

Then, the reloadImage should replace the image thusly:

function reloadImage()
{
img = document.getElementById('theimage');
img.src = '/path/to/the/image/theimage.jpg?' + Math.random();
}

The Math.random() appended to the end of the image filename ensure that the
browser will reload the image.

-Singit.info

#8 iGuest

    Hail Caesar!

  • Kontributors
  • PipPipPipPipPipPipPipPipPipPipPipPipPipPipPipPipPipPipPipPipPip
  • 5,876 posts
  • Interests:Trap17 Free Web Hosting, No Ads

Posted 29 December 2009 - 06:29 PM

thanksImage Refresh

oh man... You saved my life !

 quite good this feature using Math.Random() 

 IŽd never thought about it, too simple and work perfectly. 

 

thnx !

 Najib El Alam



#9 kshan

    Newbie [Level 3]

  • Kontributors
  • PipPipPip
  • 43 posts
  • Gender:Male
  • Location:London
  • myCENT:59.62

Posted 12 January 2010 - 04:04 PM

I am sorry but didnt get your quation. but may the below code will help you.
	  
	  <IMG src="image_name.jpg" width="275" height="200" border="1" name="refresh">
	  <script language="JavaScript" type="text/javascript">
	  <!--
	  var t = 120 // interval in seconds
	  image = "image_name.jpg" //name of the image
	  function Start() {
	  tmp = new Date();
	  tmp = "?"+tmp.getTime()
	  document.images["refresh"].src = image+tmp
	  setTimeout("Start()", t*1000)
	  }
	  Start();
	  // -->
	  </SCRIPT>

Try this one - I use it to refresh my webcam pics. Just insert your on image address and interval time

Notice from rvalkass:

Added code tags around the code.


#10 Semsem

    Member [Level 2]

  • Kontributors
  • PipPipPipPipPip
  • 84 posts
  • Gender:Male
  • myCENT:10.78

Posted 12 January 2010 - 06:17 PM

Couldn't this also be done with AJAX?




Reply to this topic


This post will need approval from a moderator before this post is shown.

  


1 user(s) are reading this topic

0 members, 1 guests, 0 anonymous users