Help me w/ my timer, please

Is this the one in question?

<Script language='Javascript'>var rndNum = Math.floor(Math.random() * 10000);eval("var CDTDate" + rndNum + " = 'September 10, 2002 12:00:00 PM CST';");document.writeln("<form name='CDTform" + rndNum + "' action='Javascript:void(0);'>");document.writeln('<font size=2 color=darkblue>Lance\'s and Amy\'s first trip to the World (together):earseek::bounce:</font><br>');document.writeln("<input type=text value='' size=40 name='WrittenByJamesMVenglarikII'>");document.writeln("</form>");if (theFunction) theFunction += "var d = new Date();";else var theFunction = "var d = new Date();";theFunction += "var c = new Date('" + eval("CDTDate" + rndNum) + "');";theFunction += "var tzo = (c.getTimezoneOffset() - d.getTimezoneOffset()) * 60;";theFunction += "var diff = ((c - d)/1000) + tzo;";theFunction += "var days = Math.floor(diff / 86400);";theFunction += "var rem = diff - (days * 86400);";theFunction += "var hours = Math.floor(rem / 3600);";theFunction += "rem = rem - (hours * 3600);";theFunction += "var minutes = Math.floor(rem / 60);";theFunction += "rem = rem - (minutes * 60);";theFunction += "var seconds = Math.floor(rem);";theFunction += "if ((days < 0) | (hours < 0) | (minutes < 0) | (seconds < 0)) ";theFunction += "var out = 'Hanging out at the Castle';";theFunction += "else ";theFunction += "var out = ' ' + days + ' days ' + hours + ' hrs. ' + minutes + ' mins. ' + seconds + ' secs.';";theFunction += "document.forms.CDTform" + rndNum + ".elements.WrittenByJamesMVenglarikII.value = out;";setInterval(theFunction, 1000);</Script>

If so I may be able to fix it.

JC
 
JC: yes, that's the one. I think it was missing the backslashes in front of the single quotes that were in the text. Help would be appreciated, oh one-who-can-edit-others'-signatures :)

albiats: not sure why an error wasn't showing up - sometimes you can surpress the errors with settings in the browsers. I'm not sure why it would then not show up when posted into her signature, although I have seen instances where this would happen because the User put a whole bunch of smilies in their text. This causes a problem in that when the text is written back out, it wraps that code at a certain length (not sure what it is), and it was still in the text part, trying to write out the smilies.

Reducing the number of smilies to a few usually solves this problem.

I have seen Netscape Users not get the escape-code sequence copied over when they cut and paste, so I was thinking that that might have been the culprit, but I'm not sure why the generated code would be the exact same in her signature but still not work - the only thing I can think of is that something before the Countdown Timer in the signature caused this - e.g. non-closed text or some misplaced or forgotten tag.

Sorry I can't come up with more...

- Jim
 
Whoever just changed Amy's signature, it's now experiencing exactly what I was talking about: the single quotes aren't escaped...

- Jim
 
It's the vB code that was already in her sig. This wasn't the first time it has happened, that's how I knew to look for it. If the vB code is changed to straight HTML then it works fine.

I haven't looked at a page source code to see what is actualy happening, but I will do so soon.

JC
 


I'm assuming it's ok for everyone else too?

Jim, you must have loaded the page right before I swapped out the vB for the HTML.

JC
 
Thank you so much, all of you, for your help! I freely admit that I am only semi-computer literate so forgive my following questions..

I have IE 5.5, Comcast cable modem, P4 computer. This is the only computer I post from. Did I do something to make my C&P not work correctly? I did compare it line for line, but since I am not at all familiar w/ programming language, I may have missed a \ here or there. Or, are my settings somehow causing the vB code to not work? Also, I am pretty sure I don't have my settings where error messages are suppressed, but I may. Finally I have not yet noticed a problem w/ my C&P before---could I have one that only shows up sporadically?

Ok, enough of the computer moron questions. Again, thanks for all of your help, and my timer now says exactly what I want it to say!
 


We can't quite figure it out for sure so I'm certain you didn't do anything wrong at all.

I only knew how to fix it because this exact thing happened before.

JC
 
Originally posted by Mr. J. Cricket

I don't really want to use Amy as a Guneia (sp) pig.

JC

I've been called worse before;) ! Feel free to use me as an example.
 
JC: the other thread did show an example of what I was talking about - the missing backslashes.

Amy: I don't think that it's anything you did at all. Right now I'm not sure why those characters didn't either copy over or weren't stored in the database properly.

- Jim
 

GET A DISNEY VACATION QUOTE

Dreams Unlimited Travel is committed to providing you with the very best vacation planning experience possible. Our Vacation Planners are experts and will share their honest advice to help you have a magical vacation.

Let us help you with your next Disney Vacation!











facebook twitter
Top