Help converting Javascript to VBscript
Tuesday, February 6, 2007 by sweetasman01 | Discussion: DesktopX Development
I need help changing this javascript to VBscript.
[code]
function $(name) {
return document.getElementById(name);
}
function init() {
updatePS3Countdown();
resizeImages();
}
function updatePS3Countdown() {
var cA = $("counterActivator");
if (cA) {
var now = new Date();
var rel = new Date(2007, 02, 23, 24, 0, 0);
var mil = rel.getTime() - now.getTime();
if (mil > 0) {
var secs = Math.round(mil / 1000);
// Time in Days
var days = (secs - secs % (60 * 60 * 24)) / (60 * 60 * 24);
secs = secs % (60 * 60 * 24);
// Time in hours
var hrs = (secs - secs % (60 * 60)) / (60 * 60);
secs = secs % (60 * 60);
// Time in Minutes
var mnts = (secs - secs % 60) / 60;
secs = secs % 60;
$("cDays").innerHTML = days;
$("cHours").innerHTML = hrs;
$("cMinutes").innerHTML = mnts;
$("cSeconds").innerHTML = secs;
window.setTimeout("updatePS3Countdown()", 1000);
}
}
}
[/code]
Thanks
Reply #2 Wednesday, February 7, 2007 5:59 PM
Please login to comment and/or vote for this skin.
Welcome Guest! Please take the time to register with us.
There are many great features available to you once you register, including:
- Richer content, access to many features that are disabled for guests like commenting on the forums and downloading skins.
- Access to a great community, with a massive database of many, many areas of interest.
- Access to contests & subscription offers like exclusive emails.
- It's simple, and FREE!







Reply #1 Tuesday, February 6, 2007 6:02 PM
You know that JS can be used in DX?