473,396 Members | 2,029 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,396 software developers and data experts.

Need help with the following script

Hello,

I have a simple script that will reload http://website/CAM1picture.jpg every
xx minutes. I'm trying to add a form <input type="submit" value="CAM1"
name="B1"><input type="submit" value="CAM2" name="B1"> So when I click on
CAM2 button it will reload http://website/CAM2picture.jpg and when I click
on CAM3 button it will reload http://website/CAM3picture.jpg and so on.

I appreciate if someone can show me how to do it. Here's a copy of the html
with the script.

==== Start HERE ===
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">
<html>
<head>
<title>ICUx10</title>

<meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1">
<script type="text/javascript">
<!-- hide
var x = 10;
var y = 1;
var now;

function countdown() {
x = x-y;
document.form1.clock.value = x;
if (x <= 1) reload();
timerID = setTimeout("countdown()", 1000); }

function reload() {
now = new Date();
var camImg = "http://website/CAM1picture.jpg" + "?" + now.getTime();
document.ICUx10.src = camImg;
x = 10;
document.form1.clock.value = x; }
-->
</script>
</head>
<body onload="countdown()">
<p class="imgcen" align="center"><b><i><font face="Arial" color="#000080"
size="7">Sarceno's
Webcam</font></i></b>
<p class="imgcen" align="center">&nbsp;
<div align="center">
<center>
<table border="15" cellspacing="0" cellpadding="0">
<tr>
<td width="100%" align="center"><img name="ICUx10"
src="http://website/CAM1picture.jpg" border=0 width=320 height=240></td>
</tr>
</table>
</center>
</div>
<p class="imgcen" align="center">
<form action="" name="form1" class="timer">
<p align="center"><font color="#ff0000">This screen will refresh
in</font> <input TYPE="text" NAME="clock" SIZE="2">
<font color="#ff0000">second</font><br>
</form><br>
<div align="center">
<center>
<table border="0" cellspacing="0" cellpadding="0">
<tr>
<td width="100%">
<form method="POST">
<p><input type="submit" value="CAM1" name="B1"><input
type="submit" value="CAM2" name="B1"><input type="submit" value="CAM3"
name="B1"></p>
</form>
</td>
</tr>
</table>
</center>
</div>
</body>
</html>

==== END HERE ===

Thanks
Jul 20 '05 #1
1 1636
Try using '<input type="button">' instead of '<input type="submit">' with
the 'onclick' event handler.
Also consider using a parameter with the 'reload' function.

I would have provided you the code to explain my view...but then, and who
wouldn't agree, programmers are lazy...
If you still need help, just inform me...

Jitendra Tulsiani

"Roel" <rs******@nospam.comcast.net> wrote in message
news:i2Nib.119864$%h1.127776@sccrnsc02...
Hello,

I have a simple script that will reload http://website/CAM1picture.jpg every xx minutes. I'm trying to add a form <input type="submit" value="CAM1"
name="B1"><input type="submit" value="CAM2" name="B1"> So when I click on
CAM2 button it will reload http://website/CAM2picture.jpg and when I click on CAM3 button it will reload http://website/CAM3picture.jpg and so on.

I appreciate if someone can show me how to do it. Here's a copy of the html with the script.

==== Start HERE ===
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">
<html>
<head>
<title>ICUx10</title>

<meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1">
<script type="text/javascript">
<!-- hide
var x = 10;
var y = 1;
var now;

function countdown() {
x = x-y;
document.form1.clock.value = x;
if (x <= 1) reload();
timerID = setTimeout("countdown()", 1000); }

function reload() {
now = new Date();
var camImg = "http://website/CAM1picture.jpg" + "?" + now.getTime();
document.ICUx10.src = camImg;
x = 10;
document.form1.clock.value = x; }
-->
</script>
</head>
<body onload="countdown()">
<p class="imgcen" align="center"><b><i><font face="Arial" color="#000080" size="7">Sarceno's
Webcam</font></i></b>
<p class="imgcen" align="center">&nbsp;
<div align="center">
<center>
<table border="15" cellspacing="0" cellpadding="0">
<tr>
<td width="100%" align="center"><img name="ICUx10"
src="http://website/CAM1picture.jpg" border=0 width=320 height=240></td>
</tr>
</table>
</center>
</div>
<p class="imgcen" align="center">
<form action="" name="form1" class="timer">
<p align="center"><font color="#ff0000">This screen will refresh
in</font> <input TYPE="text" NAME="clock" SIZE="2">
<font color="#ff0000">second</font><br>
</form><br>
<div align="center">
<center>
<table border="0" cellspacing="0" cellpadding="0">
<tr>
<td width="100%">
<form method="POST">
<p><input type="submit" value="CAM1" name="B1"><input
type="submit" value="CAM2" name="B1"><input type="submit" value="CAM3"
name="B1"></p>
</form>
</td>
</tr>
</table>
</center>
</div>
</body>
</html>

==== END HERE ===

Thanks

Jul 20 '05 #2

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

Similar topics

0
by: Arg | last post by:
I posted this to alt.comp.lang.php last week and got no response so I am reposting it here today... I am trying to use the following script to allow users to download files with some of the file...
12
by: jason | last post by:
Access 2000: I have a customer-inventory table I need to loop through and compile a list of all the inventory items the customer is tracking. The problem I am finding is that a simple loop...
4
by: Derek | last post by:
Hi, I've built a rather large CGI that dumps a lot of data and a fairly complex javascript app out to the client's browser. Granted this may be poor style according to someone web design...
8
by: Tom | last post by:
Please help. I need a quick little scrpit to place on a web page that will count how many days have passed since January 1, 1970. I have ZERO experience writing ANY scripts. Anyone have any...
2
by: Mike Button | last post by:
Hello all, I am really really desperate on what I should do, and I am asking for help from anyone in this newsgroup, here's the situation: I am creating a form that is being run on a server...
3
by: ChrisWinterscheid | last post by:
We are running DB2 8.1 on AIX 5.2. DB2level shows: DB21085I Instance "db2inst1" uses "32" bits and DB2 code release "SQL08016" with level identifier "02070106". Informational tokens are "DB2...
9
by: Mickey Segal | last post by:
The long-simmering Eolas patent dispute: http://www.microsoft.com/presspass/press/2003/oct03/10-06EOLASPR.mspx has led to an optional Microsoft Update: http://support.microsoft.com/kb/912945/en-us...
3
by: chrisg | last post by:
Hi All, I've been struggeling with this for a while now, and I was wondering if anyone could help me. given: drop table GENCMP.SCRIPTS; ...
16
by: Okonita via DBMonster.com | last post by:
Hi all, I am comming along with all this Linus/DB2/scripting business...I am no longer scared of it!! (LOL). But, I need to create a .ksh script that does a REORGCHK and output only tables...
4
by: Jonathan Wood | last post by:
I'm trying to duplicate an HTML sample I have using my ASP.NET pages. The sample contains the following within the <headtag: <script type="text/javascript" src="flashobject.js"></script>...
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: nemocccc | last post by:
hello, everyone, I want to develop a software for my android phone for daily needs, any suggestions?
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...
0
by: Hystou | last post by:
There are some requirements for setting up RAID: 1. The motherboard and BIOS support RAID configuration. 2. The motherboard has 2 or more available SATA protocol SSD/HDD slots (including MSATA, M.2...
0
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,...
0
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...
0
tracyyun
by: tracyyun | last post by:
Dear forum friends, With the development of smart home technology, a variety of wireless communication protocols have appeared on the market, such as Zigbee, Z-Wave, Wi-Fi, Bluetooth, etc. Each...
0
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,...

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.