473,385 Members | 1,673 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,385 software developers and data experts.

Replace old image: question


Can someone please help me with this problem? I don't know if this is
possible in Java, so if it's not please point me in the right direction
or to the right newsgroup! (I'm a newby to Java scripting).

On a web page I have a webcam type image that updates every minute. I
wish to conditionally replace this image with an apology image in the
event that my upload fails for more than an hour. I guess what I want is
some script that will check the image file timestamp (last modified
time), and if it's more than an hour old replace it with the apology
image. I've scoured the web for ideas but so far found nothing. Can
anyone write the script for me? I'd be very grateful!

Thankyou in anticipation,
Andy.
--

Jul 23 '05 #1
3 1734
"Andy" <an**@not.telling.you> wrote in message
news:AM**************@i.am.not.telling.you...

Can someone please help me with this problem? I don't know if this is
possible in Java, so if it's not please point me in the right direction
or to the right newsgroup! (I'm a newby to Java scripting).

On a web page I have a webcam type image that updates every minute. I
wish to conditionally replace this image with an apology image in the
event that my upload fails for more than an hour. I guess what I want is
some script that will check the image file timestamp (last modified
time), and if it's more than an hour old replace it with the apology
image. I've scoured the web for ideas but so far found nothing. Can
anyone write the script for me? I'd be very grateful!


Just a tip (since you say you're a newbie...):

You use the word "Java" and "Java scripting" (two words).

You *are* aware of the fact that Java and JavaScript is two
completely different languages that have nothing to do with
each other?

Java is a fullblown OO programming language developed by Sun,
and JavaScript originated at Netscape, and is now an (extended)
implementation of ECMAScript.

Just thought I mention it, as it can severely mislead your
searches for information...

As to your question, That would best be done on the server,
and not in script in the clients browser.

--
Dag
58°26'15.9" N 008°46'45.5" E
Jul 23 '05 #2
Good point about the differences between Java and Javascript, though I
disagree that it would be best done on the server. Depending on what is
needed, that would mean another (messy) page reload.

Most sites with pictures seem to dynamically replace images nowadays
without a page reload.


Dag Sunde wrote:
"Andy" <an**@not.telling.you> wrote in message
news:AM**************@i.am.not.telling.you...
Can someone please help me with this problem? I don't know if this is
possible in Java, so if it's not please point me in the right direction
or to the right newsgroup! (I'm a newby to Java scripting).

On a web page I have a webcam type image that updates every minute. I
wish to conditionally replace this image with an apology image in the
event that my upload fails for more than an hour. I guess what I want is
some script that will check the image file timestamp (last modified
time), and if it's more than an hour old replace it with the apology
image. I've scoured the web for ideas but so far found nothing. Can
anyone write the script for me? I'd be very grateful!

Just a tip (since you say you're a newbie...):

You use the word "Java" and "Java scripting" (two words).

You *are* aware of the fact that Java and JavaScript is two
completely different languages that have nothing to do with
each other?

Java is a fullblown OO programming language developed by Sun,
and JavaScript originated at Netscape, and is now an (extended)
implementation of ECMAScript.

Just thought I mention it, as it can severely mislead your
searches for information...

As to your question, That would best be done on the server,
and not in script in the clients browser.


Jul 23 '05 #3
On Mon, 05 Jul 2004 18:24:25 GMT, Joe Bloggs wrote:
Dag Sunde wrote:
"Andy" <an**@not.telling.you> wrote in message
...please do not top-post Andy, it is most confusing..
<http://www.physci.org/codes/javafaq.jsp#netiquette>
see further comment below.
On a web page I have a webcam type image that updates every minute. I
wish to conditionally replace this image with an apology image in the
event that my upload fails for more than an hour. .......I guess what I want is
some script that will check the image file timestamp (last modified
time), and if it's more than an hour old replace it with the apology
image. I've scoured the web for ideas but so far found nothing. Can
anyone write the script for me? I'd be very grateful!
... As to your question, That would best be done on the server,
and not in script in the clients browser.

How do your users get fresh images?
If the page regularly refreshes itself then
Dag's suggestion is probably the best.
Simply swap the image name of "web-cam.jpg"
or "apology.jpg" to the "current-image.jpg"
that the web page requests and your users
will see whatever image is appropriate.
I disagree that it would be best done on the server. Depending on what is
needed, that would mean another (messy) page reload.

Most sites with pictures seem to dynamically replace images nowadays
without a page reload.


It is possible to dynamically swap images,
but if your page is getting fresh web-cam
pics it is already reloading some data.

This all becomes a lot more clear if we
can see your page. What's the URL?

--
Andrew Thompson
http://www.PhySci.org/ Open-source software suite
http://www.PhySci.org/codes/ Web & IT Help
http://www.1point1C.org/ Science & Technology
Jul 23 '05 #4

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

16
by: juglesh | last post by:
Hello, I need to look through the text on a page and replace certain words with an image or other word something like: read document find all instances of the word "blah" change all...
15
by: Jake | last post by:
Not sure if this can be done with javascript but I would like to find a way to detect if an image is missing and replace it with a default image instead of the dreaded RED X showing up. So - Is...
3
by: Al | last post by:
Hi all... I have created an aspx page that contains an animated GIF. I am using javascript and location.replace to redirect from this page to another aspx page which takes several seconds to...
0
by: lc | last post by:
I'm building a small image gallery type of site and along with it I'm adding a few pages for site maintenance. One of the maintenance functions is to replace an image (haven't tried delete and new...
4
by: Nel | last post by:
Hi all, I am struggling with understanding a small eregi problem in php4. My code: <?PHP $htmlsource = '<img src="pics/hotdog.gif"> text text <img src="pics/silly%20sausage.gif"> ';...
12
by: Charlie King | last post by:
As I understand it, the use of FIR* to replace heading tags with images in visually enabled CSS browsers is now frowned upon on the basis that some screen readers will *nor* read back text that is...
2
by: sanju | last post by:
Hi, I am struggling to replace a bit value 'True' or 'False' with a image true.gif or false.gif and bind it to a repeater control. I am getting values 'true' or 'false' depending on whether...
3
by: ©® | last post by:
I have a whole lot of entries listed as: <image><filename> and would like to search and replace so the end result is so: <image> <filename> i.e. there is a return/enter after <image> I am...
1
by: neovantage | last post by:
Hey all, I am using a PHP script which creates headings at run time in a sense at page execution. I am stuck a with a very little problem which i am sure i will have the solution from experts. ...
1
by: CloudSolutions | last post by:
Introduction: For many beginners and individual users, requiring a credit card and email registration may pose a barrier when starting to use cloud servers. However, some cloud server providers now...
0
by: Faith0G | last post by:
I am starting a new it consulting business and it's been a while since I setup a new website. Is wordpress still the best web based software for hosting a 5 page website? The webpages will be...
0
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 3 Apr 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 former...
0
by: aa123db | last post by:
Variable and constants Use var or let for variables and const fror constants. Var foo ='bar'; Let foo ='bar';const baz ='bar'; Functions function $name$ ($parameters$) { } ...
0
by: ryjfgjl | last post by:
If we have dozens or hundreds of excel to import into the database, if we use the excel import function provided by database editors such as navicat, it will be extremely tedious and time-consuming...
0
by: ryjfgjl | last post by:
In our work, we often receive Excel tables with data in the same format. If we want to analyze these data, it can be difficult to analyze them because the data is spread across multiple Excel files...
0
by: emmanuelkatto | last post by:
Hi All, I am Emmanuel katto from Uganda. I want to ask what challenges you've faced while migrating a website to cloud. Please let me know. Thanks! Emmanuel
0
BarryA
by: BarryA | last post by:
What are the essential steps and strategies outlined in the Data Structures and Algorithms (DSA) roadmap for aspiring data scientists? How can individuals effectively utilize this roadmap to progress...
1
by: Sonnysonu | last post by:
This is the data of csv file 1 2 3 1 2 3 1 2 3 1 2 3 2 3 2 3 3 the lengths should be different i have to store the data by column-wise with in the specific length. suppose the i have to...

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.