Tycoon Talk
Become a Big fish!
The number 1 forum for online business!
Post topics, ask questions, share your knowledge.
Tycoon Talk is part of Freelancer.com - find skilled workers online at a fraction of the cost.

JavaScript Forum


You are currently viewing our JavaScript Forum as a guest. Please register to participate.
Login



Reply
Countdown Clock Javascript with on click not working
Old 01-31-2009, 07:47 PM Countdown Clock Javascript with on click not working
ambercakes's Avatar
Junior Talker

Posts: 3
Name: Josie
Trades: 0
Hello. I am new to posting here & wanted some help on a javascript code I have. I can not get it to go to my site when clicked on. It has an error that says something like:
Line: 139
Char:1
Error:Object expected
Code:0
URL:www.ambercakes.com/CalenderClocksVal.html

And the Line that is 139 is where the code starts below.
I will be using it with countdown clocks. I see it works for someone else on their webpage but not mine. What am I doing wrong? Please help.

The coding:

<table border="0" width="300" background="http://ambercakes.com/CountdownClock...hearts4CDC.png" height="225" style="border-collapse: collapse">
<tr>
<td onClick="FP_goToURL(/*href*/'http:www.ambercakes.com')">
<p align="center" class="style32"><font size="6">
<script language="JavaScript">
<!--
var today = new Date;
var Future0 = new Date;
ThisYear = 2009;
var FutureMonth = 01;
var FutureDate = 13;
var faraevent = "Valentines";
Future0.setMonth(FutureMonth, FutureDate);
Future0.setFullYear(ThisYear);
today1 = Date.parse(today);
future1 = Date.parse(Future0);
secleft = future1 - today1;
miliday = 24 * 60 * 60 * 1000;
daysleft = secleft/miliday;
daysleftint = Math.round(daysleft);
if (daysleftint > 1)
document.write( 1 + daysleftint, " days until ", faraevent , "! ");
else if (daysleftint == 1)
document.write(faraevent, " is tomorrow! ");
else if (today1 == future1)
document.write(faraevent, " is today! ");
//-->
</script>
</font></td>
</tr>
</table>


It works at this site: http://www.noelladesigns.com/Countdo...ownBanners.htm

But not my site: http://ambercakes.com/CountdownClocksVal.html


Thanks in Advance!
Josie

Last edited by ambercakes; 02-01-2009 at 02:17 AM.. Reason: More Information
ambercakes is offline
Reply With Quote
View Public Profile
 
 
Register now for full access!
Old 02-01-2009, 09:10 AM Re: Countdown Clock Javascript with on click not working
Sleeping Troll's Avatar
Ultra Talker

Posts: 351
Name: Butch Begy
Trades: 0
<td>
<p align="center" class="style32" onClick="FP_goToURL(/*href*/'http:www.ambercakes.com')"><font size="6">
<script language="JavaScript">

p.s. close your tags!
__________________
Sleeping Troll, EMUSE, Mind Expansion...Truly serendipity!
Sleeping Troll is offline
Reply With Quote
View Public Profile
 
Old 02-02-2009, 03:31 AM Re: Countdown Clock Javascript with on click not working
ambercakes's Avatar
Junior Talker

Posts: 3
Name: Josie
Trades: 0
Hi Sleeping Troll and thanks for your help but it is doing the same thing. The only thing I noticed that was different when I clicked on the image was: Is I have to click on the numbers and words to get it to say the error when before it use to be on the heart part. Weird. I just cannot figure it out at all.
Also, I do not see any tags I did not close. Please point the tags out. Thanks for any more help!
ambercakes is offline
Reply With Quote
View Public Profile
 
Old 02-02-2009, 04:11 AM Re: Countdown Clock Javascript with on click not working
ambercakes's Avatar
Junior Talker

Posts: 3
Name: Josie
Trades: 0
Well, I'll be darn. I got this on my own just by LUCK. I had to put this code on the body of the source and then the image was linkable when I clicked on it. Here is the code for anyone else out there who may need it. Thanks for your try at it Sleeping Troll.

Code to put in the source html:

<script language="JavaScript">
<!--
function FP_goToURL(url) {//v1.0
window.location=url;
}
// -->
</script>
ambercakes is offline
Reply With Quote
View Public Profile
 
Reply     « Reply to Countdown Clock Javascript with on click not working
 

Thread Tools Search this Thread
Search this Thread:

Advanced Search

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

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are Off
Pingbacks are Off
Refbacks are Off





   
RSS Feed  Feeds: RSS   JS   XML
RSS Feed  Feeds for this forum: RSS   JS   XML



Page generated in 0.13893 seconds with 12 queries