JavaScript Development
 
Forums: » Register « |  User CP |  Games |  Calendar |  Members |  FAQs |  Sitemap |  Support | 
User Name:
Password:
Remember me

The Shed is going Social! Join us on FaceBook and Twitter and chime in on the conversation.

Go Back   Dev Shed ForumsWeb DesignJavaScript Development

Reply
Add This Thread To:
  Del.icio.us   Digg   Google   Spurl   Blink   Furl   Simpy   Y! MyWeb 
Thread Tools Search this Thread Rate Thread Display Modes
 
Unread Dev Shed Forums Sponsor:
  #1  
Old July 29th, 2001, 05:36 AM
Maglight Maglight is offline
Contributing User
Dev Shed Newbie (0 - 499 posts)
 
Join Date: Jun 2001
Posts: 67 Maglight User rank is Just a Lowly Private (1 - 20 Reputation Level) 
Time spent in forums: < 1 sec
Reputation Power: 12
JavaScript-Countdown via perl script?

Hi,

i do have no knowledge about javascript - based on this i need some help for the following:

Let's say i have a perl routine with a saved time splitted into the variables $days, $hours, $mins ...

Now i want to display on the html-output of the perl-script anywhere a live countdown like:

Countdown:
-------------------------------
|days|hours|minutes|seconds|
-------------------------------

Would be great if anyone could create me a short snippet how i could insert anything like this ...

Thanks!

Reply With Quote
  #2  
Old July 29th, 2001, 10:13 AM
DJdrenaline DJdrenaline is offline
Contributing User
Dev Shed Novice (500 - 999 posts)
 
Join Date: Jun 2001
Location: Toronto, Ontario, Canada
Posts: 631 DJdrenaline User rank is Just a Lowly Private (1 - 20 Reputation Level) 
Time spent in forums: 7 m 19 sec
Reputation Power: 12
From your perl/cgi script, you should write the whole document.

print <<END_OF_PAGE;
<html><head>...</head><body>
........ all the content.....
$day , $hour , etc.
...
</body></html>

END_OF_PAGE

Using this (being a perl/cgi newbie -- started to learn today, lol) I dont know if the time could be updated, unless you use javascript. I'm not sure if defining the javascript variables with the perl variables will work though, but you can give it a try.

print <<END_OF_PAGE;
<html><head><script language="javascript">
var secs=$seconds
function updateSec() {
secs++;
document.write(secs);
SecsTimeout=setTimeout("updateSec()",1000)
}
updateSec()
</script><body>..</body></html>
END_OF_PAGE

Reply With Quote
Reply

Viewing: Dev Shed ForumsWeb DesignJavaScript Development > JavaScript-Countdown via perl script?

Developer Shed Advertisers and Affiliates



Thread Tools  Search this Thread 
Search this Thread:

Advanced Search
Display Modes  Rate This Thread 
Rate This Thread:


Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

vB code is On
Smilies are On
[IMG] code is On
HTML code is Off
View Your Warnings | New Posts | Latest News | Latest Threads | Shoutbox
Forum Jump

Forums: » Register « |  User CP |  Games |  Calendar |  Members |  FAQs |  Sitemap |  Support | 
  
 


Powered by: vBulletin Version 3.0.5
Copyright ©2000 - 2013, Jelsoft Enterprises Ltd.

© 2003-2013 by Developer Shed. All rights reserved. DS Cluster - Follow our Sitemap