473,915 Members | 3,885 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

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 1771
"Andy" <an**@not.telli ng.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.telli ng.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.telli ng.you> wrote in message
...please do not top-post Andy, it is most confusing..
<http://www.physci.org/codes/javafaq.jsp#net iquette>
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.jp g" 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
12416
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 instances of the word "blah" to <img src="MyPicture.jpg" >
15
6231
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 Javascript the way? Or should I look elesewhere? Thanks in Advance!
3
3450
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 load. When location.replace is called the animated GIFs in the first page stop animating. Is this standard behaviour? If so, is there an easy work around to prevent this?
0
1230
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 image yet). All available images sit in a subfolder. In one par of the form with image replace request I show a datalist hooked up to a paging data table. The other part of the form show a single big image that's being edited and is hooked up...
4
2468
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"> '; eregi('(=")(pics/)(+...)(")',$htmlsource,$imagesintext); ?>
12
2639
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 marked up by CSS to be invisible or hidden. So... If I want to replace headings with images (because my client wants to use his specific font for headings where possible), what's the best way to do it?
2
1607
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 user is logged in or not(with asp.net membership provider) Getting true or false with this <%# Membership.GetUser(Eval("UserID")).IsOnline % and
3
26133
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 using Notepad++). I highlighted text on two lines and when I tried Search and Replace (Ctrl+H), I get the "square" which represents Return/Enter in the search box but I cannot copy it to the replace box.
1
3402
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. The problem is when it creates transparent PNG format image then and it pixel ate the image. e.g. If i am using a gradient in background then it vary in color range. Now when i used that php script it generates image successfully but it pixel ate...
0
10039
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However, people are often confused as to whether an ONU can Work As a Router. In this blog post, we’ll explore What is ONU, What Is Router, ONU & Router’s main usage, and What is the difference between ONU and Router. Let’s take a closer look ! Part I. Meaning of...
0
9883
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
11359
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
10928
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
11069
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,...
1
8102
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...
0
5944
by: TSSRALBI | last post by:
Hello I'm a network technician in training and I need your help. I am currently learning how to create and manage the different types of VPNs and I have a question about LAN-to-LAN VPNs. The last exercise I practiced was to create a LAN-to-LAN VPN between two Pfsense firewalls, by using IPSEC protocols. I succeeded, with both firewalls in the same network. But I'm wondering if it's possible to do the same thing, with 2 Pfsense firewalls...
1
4779
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
3
3370
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.