473,796 Members | 2,839 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

Reload different images without page refresh

79 New Member
In a html page, a tag <img src="http://www......jpg"> is referred to a image.

How can i automatically reload the image with another refering image (different filenames) being displayed? Better to use PHP because could it be better when implemented in ajax.
Dec 6 '08 #1
2 4703
Markus
6,050 Recognized Expert Expert
@kenneth6
I'd use Javascript. You can easily set the new image by something like img.src="img.jp g". More efficient than PHP, IMO.
Dec 6 '08 #2
nathj
938 Recognized Expert Contributor
I agree with Markus as this is pretty much what JS is fir. Also if a user doesn't have JS enabled then this sort of system \can degrade nicely to a simple image.

The alternative to using JS is to use flash (or similar swish I believe is free flash equivalent), this is a bit more involved to update when the time comes but nothing too tricky.

AJAX is a good solution for image refresh when you want the image to change as the result of some user action.

Cheers
nathj
Dec 7 '08 #3

Sign in to post your reply or Sign up for a free account.

Similar topics

4
2497
by: STEPHEN GOODE | last post by:
I have a php script that dynamically creates images, reusing image files on the server to save space and clutter. The problem is described in the steps below: 1. User clicks on a button. 2. Same page loads, but the php script creates a new image in an old file. 3. It displays the image file, but the old image shows, even though the file contains the new image.
3
2129
by: eric rudolph | last post by:
I am writing a photo gallery and suppose 8 photos are displayed. When the user clicks on a button under the picture, I want it to add that picture name to a "favorites" list within the session data, but NOT leave the page the user is on. How could I do this? thanks
1
2896
by: Cooper | last post by:
Hello, is possible to disable the reload (or update, for ie) of the a web page? If yes, what i do? Otherwise if isn't possible, what i do for to set the default value of a form when a user do a reload of update of the web page? Thank you, Cooper.
2
26281
by: JR | last post by:
Is there a script available to automatically reload images on visiting a page? I change images once a week and they have the same name so I'm not changing the page code. Some people have the previous week's image in their cache. I'd rather not put a message line on the page asking the visitor to hit the refresh button nor use a code that reloads the whole page unless reloding the page is an only option. Thanks for your suggestions, ...
2
2634
by: UJ | last post by:
I have a page with code in it to automatically refresh the page every 30 seconds. Works great. But if I do anything on the page (which resets the timer) and then it times out to refresh, I get the 'The page cannot be refreshed without resending the information. Click Retry to send the information again, or click Cancel to return to the page that you were trying to view.' Anybody know of any way to stop that message from coming up? ...
0
473
by: Martin Ho | last post by:
Hey Everyone, I really hope there is someone who can figure out this problem. Honestly, I spent 3 days now trying to find the solution, but nothing works. I'll try to explain the problem shortly, so I don't take too much of your time. Problem:
6
25916
by: Rain | last post by:
Does anyone have an idea on how to programmatically force a page to reload(refresh)? Im developing a asp.net web application using C#.. any help would be nice... Thanks in advance!
7
2206
by: amishguy | last post by:
Hello, I am having an issue with a site I'm creating right now. I have had this issue before and I would like to figure out what the solution is instead of using workarounds as I have in the past. A little background: I have a php based site. The layout is a table based layout that was generated by slicing a large image. Most of the pages that I have problems with use PHP includes which I think has something to do with the issue.
0
9525
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can effortlessly switch the default language on Windows 10 without reinstalling. I'll walk you through it. First, let's disable language synchronization. With a Microsoft account, language settings sync across devices. To prevent any complications,...
0
10452
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers, it seems that the internal comparison operator "<=>" tries to promote arguments from unsigned to signed. This is as boiled down as I can make it. Here is my compilation command: g++-12 -std=c++20 -Wnarrowing bit_field.cpp Here is the code in...
0
10221
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven tapestry of website design and digital marketing. It's not merely about having a website; it's about crafting an immersive digital experience that captivates audiences and drives business growth. The Art of Business Website Design Your website is...
1
10169
by: Hystou | last post by:
Overview: Windows 11 and 10 have less user interface control over operating system update behaviour than previous versions of Windows. In Windows 11 and 10, there is no way to turn off the Windows Update option using the Control Panel or Settings app; it automatically checks for updates and installs any it finds, whether you like it or not. For most users, this new feature is actually very convenient. If you want to control the update process,...
0
9050
agi2029
by: agi2029 | last post by:
Let's talk about the concept of autonomous AI software engineers and no-code agents. These AIs are designed to manage the entire lifecycle of a software development project—planning, coding, testing, and deployment—without human intervention. Imagine an AI that can take a project description, break it down, write the code, debug it, and then launch it, all on its own.... Now, this would greatly impact the work of software developers. The idea...
1
7546
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 1 May 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM). In this session, we are pleased to welcome a new presenter, Adolph Dupré who will be discussing some powerful techniques for using class modules. He will explain when you may want to use classes instead of User Defined Types (UDT). For example, to manage the data in unbound forms. Adolph will...
1
4115
by: 6302768590 | last post by:
Hai team i want code for transfer the data from one system to another through IP address by using C# our system has to for every 5mins then we have to update the data what the data is updated we have to send another system
2
3730
muto222
by: muto222 | last post by:
How can i add a mobile payment intergratation into php mysql website.
3
2924
bsmnconsultancy
by: bsmnconsultancy | last post by:
In today's digital era, a well-designed website is crucial for businesses looking to succeed. Whether you're a small business owner or a large corporation in Toronto, having a strong online presence can significantly impact your brand's success. BSMN Consultancy, a leader in Website Development in Toronto offers valuable insights into creating effective websites that not only look great but also perform exceptionally well. In this comprehensive...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.