Client Side Things
 
Forums: » Register « |  User CP |  Games |  Calendar |  Members |  FAQs |  Sitemap |  Support | 
User Name:
Password:
Remember me
Go Back   Codewalkers ForumsOther TechnologiesClient Side Things

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 Codewalkers Forums Sponsor:
AT&T devCentral & BlackBerry(r) Webcast Series: BlackBerry and GPS -Build Location Awareness into your BlackBerry Applications, July 10th-1:00PM EST. Register Today!
  #1  
Old November 10th, 2003, 08:30 AM
ntburchf ntburchf is offline
Codewalkers Newbie (0 - 499 posts)
 
Join Date: Apr 2007
Posts: 14 ntburchf User rank is Just a Lowly Private (1 - 20 Reputation Level) 
Time spent in forums: < 1 sec
Reputation Power: 0
Code Crashing a few users IE

Well, I got this clock working. But a few of my users on the forums are having some problems. Can not narrow down where exaclty or why it's crashing IE.
Any help would be great..

As a side note, How would I get it to display for non IE users, if Possible.

Code:
<script language='javascript'>
var bolMSIE = true;
function showImage(objImage) {
eval('strOldImage = objImage.src; objImage.src = JDP_'+objImage.name+'; JDP_'+objImage.name+' = strOldImage;');
}
</script>

<table border=0 cellspacing=0 cellpadding=0 class='3DNormal' style='border-top:0px;position:relative;left:20px'>
<col width=100><col width=100><col width=100><col width=100><col width=100><col width=100>
<tr>
<td class='3DNormal' style='text-align:center;border-top:0px'><b>PST: </b><span id='JDPClock_PST'> </span></td>
<td class='3DNormal' style='text-align:center;border-top:0px'><b>MST: </b><span id='JDPClock_MST'> </span></td>
<td class='3DNormal' style='text-align:center;border-top:0px'><b>CST: </b><span id='JDPClock_CST'> </span></td>
<td class='3DNormal' style='text-align:center;border-top:0px'><b>EST: </b><span id='JDPClock_EST'> </span></td>
<td class='3DNormal' style='text-align:center;border-top:0px'><b>GMT: </b><span id='JDPClock_GMT'> </span></td>
<td class='3DNormal' style='text-align:center;border-top:0px'><b>CET: </b><span id='JDPClock_CET'> </span></td>
</tr>
</table></td>
</tr>
</table>

<script language='javascript'>
function getElement(strName) {
if (bolMSIE) {
eval('objElement = document.all["'+strName+'"];');
}

else {
eval('objElement = document.'+strName+';');
}

return objElement;
}

function IfZero(num) {
return ((num <= 9) ? ('0' + num) : num);
}

function check24(hour) {
return (hour >= 24) ? hour - 24 : hour;
}

function updateClocks() {

var objJDPClock_PST = getElement('JDPClock_PST');
var objJDPClock_MST = getElement('JDPClock_MST');
var objJDPClock_CST = getElement('JDPClock_CST');
var objJDPClock_EST = getElement('JDPClock_EST');
var objJDPClock_GMT = getElement('JDPClock_GMT');
var objJDPClock_CET = getElement('JDPClock_CET');
var dtDate = new Date();
var intOffset = dtDate.getTimezoneOffset();
var intDSTAdjustment = 0;
var dtDate = new Date();
var dtGMT = new Date(dtDate.getUTCFullYear

(),dtDate.getUTCMonth(),dtDate.getUTCDay(),dtDate.  getUTCHours(),dtDate.getUTCMinutes(),dtDate.getUTC  Seconds());
if (typeof(objJDPClock_GMT) == 'object') {
objJDPClock_GMT.innerHTML = IfZero(dtGMT.getHours())+':'+IfZero(dtGMT.getMinut  es())+':'+IfZero(dtGMT.getSeconds());
}

if (typeof(objJDPClock_PST) == 'object') {
var dtPST = new Date(dtGMT.getFullYear(),dtGMT.getMonth(),dtGMT.ge  tDay(),dtGMT.getHours(),dtGMT.getMinutes()-((8+intDSTAdjustment)*60),dtGMT.getSeconds());
objJDPClock_PST.innerHTML = IfZero(dtPST.getHours())+':'+IfZero(dtPST.getMinut  es())+':'+IfZero(dtPST.getSeconds());
}

if (typeof(objJDPClock_MST) == 'object') {
var dtMST = new Date(dtGMT.getFullYear(),dtGMT.getMonth(),dtGMT.ge  tDay(),dtGMT.getHours(),dtGMT.getMinutes()-((7+intDSTAdjustment)*60),dtGMT.getSeconds());
objJDPClock_MST.innerHTML = IfZero(dtMST.getHours())+':'+IfZero(dtMST.getMinut  es())+':'+IfZero(dtMST.getSeconds());
}

if (typeof(objJDPClock_CST) == 'object') {
var dtCST = new Date(dtGMT.getFullYear(),dtGMT.getMonth(),dtGMT.ge  tDay(),dtGMT.getHours(),dtGMT.getMinutes()-((6+intDSTAdjustment)*60),dtGMT.getSeconds());
objJDPClock_CST.innerHTML = IfZero(dtCST.getHours())+':'+IfZero(dtCST.getMinut  es())+':'+IfZero(dtCST.getSeconds());
}

if (typeof(objJDPClock_EST) == 'object') {
var dtEST = new Date(dtGMT.getFullYear(),dtGMT.getMonth(),dtGMT.ge  tDay(),dtGMT.getHours(),dtGMT.getMinutes()-((5+intDSTAdjustment)*60),dtGMT.getSeconds());
objJDPClock_EST.innerHTML = IfZero(dtEST.getHours())+':'+IfZero(dtEST.getMinut  es())+':'+IfZero(dtEST.getSeconds());
}

if (typeof(objJDPClock_CET) == 'object') {
var dtCET = new Date(dtGMT.getFullYear(),dtGMT.getMonth(),dtGMT.ge  tDay(),dtGMT.getHours(),dtGMT.getMinutes()+((1-intDSTAdjustment)*60),dtGMT.getSeconds());
objJDPClock_CET.innerHTML = IfZero(dtCET.getHours())+':'+IfZero(dtCET.getMinut  es())+':'+IfZero(dtCET.getSeconds());
}
setTimeout('updateClocks()', 1000);
}
updateClocks();
</script>


Thanks in Advance,
TB..

Reply With Quote
  #2  
Old November 12th, 2003, 05:02 PM
mugane mugane is offline
Codewalkers Newbie (0 - 499 posts)
 
Join Date: Apr 2007
Location: Charlottesville, VA USA
Posts: 425 mugane User rank is Just a Lowly Private (1 - 20 Reputation Level) 
Time spent in forums: < 1 sec
Reputation Power: 2
Send a message via AIM to mugane Send a message via Yahoo to mugane
RE: Code Crashing a few users IE

You may want to use mozilla or netscape to run the javascript console - open your page and then type "javascript:" - without the quotes - in the address bar. Otherwise this is a lot of code to debug, it would take too long. Another thing you may try is to comment out portions and see if it still crashes.

Reply With Quote
Reply

Viewing: Codewalkers ForumsOther TechnologiesClient Side Things > Code Crashing a few users IE


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 | 
  
 





© 2003-2008 by Developer Shed. All rights reserved. DS Cluster 6 hosted by Hostway