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
Problem with joke of the day script... Please help. code below
Old 10-13-2006, 10:26 AM Problem with joke of the day script... Please help. code below
CircleOfLinks's Avatar
Extreme Talker

Posts: 243
Name: Danny
Location: Sydney
Trades: 1
I Need a 'joke of the day script' can anyone help? But i would like to be able to display a couple of sentences if required.
I got one but it only works fine with small amount of charactors after that i get a 'java script error.

the code is below... if you think something isnt right plese let me know.
-------------------------------------------------------

<table border="0" width="100%" bgcolor="#E8E8E8" cellspacing="0" cellpadding="0">
<tr><td width="100%">

<script>
<!--

var today_obj=new Date()
var today_date=today_obj.getDate()

var tips=new Array()
//Configure the below variable to contain the "header" of the tip
var tiptitle='<img src="../../tip.gif"> <b>Joke of the day</b><br>'

//Configure the below array to hold the 31 possible tips of the month
tips[1]='Tip 1 goes here'
tips[2]='Tip 2 goes here'
tips[3]='Tip 3 goes here'
tips[4]='Tip 4 goes here'
tips[5]='Tip 5 goes here'
tips[6]='Tip 6 goes here'
tips[7]='Tip 7 goes here'
tips[8]='Tip 8 goes here'
tips[9]='Tip 9 goes here'
tips[10]='Tip 10 goes here'
tips[11]='Tip 11 goes here'
tips[12]='Tip 12 goes here'
tips[13]='Tip 13 goes here'
tips[14]='Tip 14 goes here'
tips[15]='Tip 15 goes here'
tips[16]='Tip 16 goes here'
tips[17]='Tip 17 goes here'
tips[18]='Tip 18 goes here'
tips[19]='Tip 19 goes here'
tips[20]='Tip 20 goes here'
tips[21]='Tip 21 goes here'
tips[22]='Tip 22 goes here'
tips[23]='Tip 23 goes here'
tips[24]='Tip 24 goes here'
tips[25]='Tip 25 goes here'
tips[26]='Tip 26 goes here'
tips[27]='Tip 27 goes here'
tips[28]='Tip 28 goes here'
tips[29]='Tip 29 goes here'
tips[30]='Tip 30 goes here'
tips[31]='Tip 31 goes here'

document.write(tiptitle)
document.write(tips[today_date])

//-->
</script>

</td></tr></table>
<p align="center"><font face="arial" size="-2">Joke of the day</font><br>
<font face="arial, helvetica" size="-2"><a href="http://www.CircleOfLinks.com.au">CircleOfLinks</a></font></p>
CircleOfLinks is offline
Reply With Quote
View Public Profile Visit CircleOfLinks's homepage!
 
 
Register now for full access!
Old 10-13-2006, 08:53 PM Re: Problem with joke of the day script... Please help. code below
logic ali's Avatar
Super Talker

Posts: 104
Trades: 0
Quote:
Originally Posted by CircleOfLinks View Post
I Need a 'joke of the day script' can anyone help? But i would like to be able to display a couple of sentences if required.
I got one but it only works fine with small amount of charactors after that i get a 'java script error.
tips[1]='The reason for that I suspect is that \
you are probably placing newlines in the strings. \
If you want to wrap a line just type a backslash \
and continue on the next line';
logic ali is offline
Reply With Quote
View Public Profile
 
Old 10-15-2006, 01:10 AM Re: Problem with joke of the day script... Please help. code below
Banned

Posts: 25
Trades: 0
I Need a 'joke of the day script' can anyone help? But i would like to be able to display a couple of sentences if required.
I got one but it only works fine with small amount of charactors after that i get a 'java script error.

the code is below... if you think something isnt right plese let me know.
-------------------------------------------------------

<table border="0" width="100%" bgcolor="#E8E8E8" cellspacing="0" cellpadding="0">
<tr><td width="100%">

<script>
<!--

var today_obj=new Date()
var today_date=today_obj.getDate()

var tips=new Array()
//Configure the below variable to contain the "header" of the tip
var tiptitle='<img src="../../tip.gif"> <b>Joke of the day</b><br>'

//Configure the below array to hold the 31 possible tips of the month
tips[1]='Tip 1 goes here'
tips[2]='Tip 2 goes here'
tips[3]='Tip 3 goes here'
tips[4]='Tip 4 goes here'
tips[5]='Tip 5 goes here'
tips[6]='Tip 6 goes here'
tips[7]='Tip 7 goes here'
tips[8]='Tip 8 goes here'
tips[9]='Tip 9 goes here'
tips[10]='Tip 10 goes here'
tips[11]='Tip 11 goes here'
tips[12]='Tip 12 goes here'
tips[13]='Tip 13 goes here'
tips[14]='Tip 14 goes here'
tips[15]='Tip 15 goes here'
tips[16]='Tip 16 goes here'
tips[17]='Tip 17 goes here'
tips[18]='Tip 18 goes here'
tips[19]='Tip 19 goes here'
tips[20]='Tip 20 goes here'
tips[21]='Tip 21 goes here'
tips[22]='Tip 22 goes here'
tips[23]='Tip 23 goes here'
tips[24]='Tip 24 goes here'
tips[25]='Tip 25 goes here'
tips[26]='Tip 26 goes here'
tips[27]='Tip 27 goes here'
tips[28]='Tip 28 goes here'
tips[29]='Tip 29 goes here'
tips[30]='Tip 30 goes here'
tips[31]='Tip 31 goes here'

document.write(tiptitle)
document.write(tips[today_date])

//-->
</script>

</td></tr></table>
<p align="center"><font face="arial" size="-2">Joke of the day</font><br>
<font face="arial, helvetica" size="-2"><a href="http://www.CircleOfLinks.com.au">CircleOfLinks</a></font></p>I Need a 'joke of the day script' can anyone help? But i would like to be able to display a couple of sentences if required.
I got one but it only works fine with small amount of charactors after that i get a 'java script error.

the code is below... if you think something isnt right plese let me know.
-------------------------------------------------------

<table border="0" width="100%" bgcolor="#E8E8E8" cellspacing="0" cellpadding="0">
<tr><td width="100%">

<script>
<!--

var today_obj=new Date()
var today_date=today_obj.getDate()

var tips=new Array()
//Configure the below variable to contain the "header" of the tip
var tiptitle='<img src="../../tip.gif"> <b>Joke of the day</b><br>'

//Configure the below array to hold the 31 possible tips of the month
tips[1]='Tip 1 goes here'
tips[2]='Tip 2 goes here'
tips[3]='Tip 3 goes here'
tips[4]='Tip 4 goes here'
tips[5]='Tip 5 goes here'
tips[6]='Tip 6 goes here'
tips[7]='Tip 7 goes here'
tips[8]='Tip 8 goes here'
tips[9]='Tip 9 goes here'
tips[10]='Tip 10 goes here'
tips[11]='Tip 11 goes here'
tips[12]='Tip 12 goes here'
tips[13]='Tip 13 goes here'
tips[14]='Tip 14 goes here'
tips[15]='Tip 15 goes here'
tips[16]='Tip 16 goes here'
tips[17]='Tip 17 goes here'
tips[18]='Tip 18 goes here'
tips[19]='Tip 19 goes here'
tips[20]='Tip 20 goes here'
tips[21]='Tip 21 goes here'
tips[22]='Tip 22 goes here'
tips[23]='Tip 23 goes here'
tips[24]='Tip 24 goes here'
tips[25]='Tip 25 goes here'
tips[26]='Tip 26 goes here'
tips[27]='Tip 27 goes here'
tips[28]='Tip 28 goes here'
tips[29]='Tip 29 goes here'
tips[30]='Tip 30 goes here'
tips[31]='Tip 31 goes here'

document.write(tiptitle)
document.write(tips[today_date])

//-->
</script>

</td></tr></table>
<p align="center"><font face="arial" size="-2">Joke of the day</font><br>
<font face="arial, helvetica" size="-2"><a href="http://www.CircleOfLinks.com.au">CircleOfLinks</a></font></p>I Need a 'joke of the day script' can anyone help? But i would like to be able to display a couple of sentences if required.
I got one but it only works fine with small amount of charactors after that i get a 'java script error.

the code is below... if you think something isnt right plese let me know.
-------------------------------------------------------

<table border="0" width="100%" bgcolor="#E8E8E8" cellspacing="0" cellpadding="0">
<tr><td width="100%">

<script>
<!--

var today_obj=new Date()
var today_date=today_obj.getDate()

var tips=new Array()
//Configure the below variable to contain the "header" of the tip
var tiptitle='<img src="../../tip.gif"> <b>Joke of the day</b><br>'

//Configure the below array to hold the 31 possible tips of the month
tips[1]='Tip 1 goes here'
tips[2]='Tip 2 goes here'
tips[3]='Tip 3 goes here'
tips[4]='Tip 4 goes here'
tips[5]='Tip 5 goes here'
tips[6]='Tip 6 goes here'
tips[7]='Tip 7 goes here'
tips[8]='Tip 8 goes here'
tips[9]='Tip 9 goes here'
tips[10]='Tip 10 goes here'
tips[11]='Tip 11 goes here'
tips[12]='Tip 12 goes here'
tips[13]='Tip 13 goes here'
tips[14]='Tip 14 goes here'
tips[15]='Tip 15 goes here'
tips[16]='Tip 16 goes here'
tips[17]='Tip 17 goes here'
tips[18]='Tip 18 goes here'
tips[19]='Tip 19 goes here'
tips[20]='Tip 20 goes here'
tips[21]='Tip 21 goes here'
tips[22]='Tip 22 goes here'
tips[23]='Tip 23 goes here'
tips[24]='Tip 24 goes here'
tips[25]='Tip 25 goes here'
tips[26]='Tip 26 goes here'
tips[27]='Tip 27 goes here'
tips[28]='Tip 28 goes here'
tips[29]='Tip 29 goes here'
tips[30]='Tip 30 goes here'
tips[31]='Tip 31 goes here'

document.write(tiptitle)
document.write(tips[today_date])

//-->
</script>

</td></tr></table>
<p align="center"><font face="arial" size="-2">Joke of the day</font><br>
<font face="arial, helvetica" size="-2"><a href="http://www.CircleOfLinks.com.au">CircleOfLinks</a></font></p>
VidStars is offline
Reply With Quote
View Public Profile
 
Old 10-15-2006, 01:49 AM Re: Problem with joke of the day script... Please help. code below
CircleOfLinks's Avatar
Extreme Talker

Posts: 243
Name: Danny
Location: Sydney
Trades: 1
isnt that code the same as mine?
__________________
Danny

Please login or register to view this content. Registration is FREE
|
Please login or register to view this content. Registration is FREE
CircleOfLinks is offline
Reply With Quote
View Public Profile Visit CircleOfLinks's homepage!
 
Old 10-16-2006, 03:14 AM Re: Problem with joke of the day script... Please help. code below
seomumbai's Avatar
Skilled Talker

Posts: 98
Trades: 0
I think problem is with Document.Write(tips[today_date]) if you as asking for today_date it will give you the whole date but not integer. so calling an array with undescribed constant will cause problems. surely.
seomumbai is offline
Reply With Quote
View Public Profile
 
Reply     « Reply to Problem with joke of the day script... Please help. code below
 

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.54568 seconds with 12 queries