Today's Posts Follow Us On Twitter! TFL Members on Twitter  
Forum search: Advanced Search  
Navigation
Marketplace
  Members Login:
Lost password?
  Forum Statistics:
Forum Members: 24,254
Total Threads: 80,792
Total Posts: 566,471
There are 1138 users currently browsing (tf).
 
  Our Partners:
 
  TalkFreelance     Design and Development     Programming     Javascript :

javascript error: 'undefined'

Thread title: javascript error: 'undefined'
Reply    
    Thread tools Search this thread Display Modes  
04-17-2009, 03:11 AM
#1
Chad is offline Chad
Chad's Avatar
Status: Junior Member
Join date: Jun 2006
Location:
Expertise:
Software:
 
Posts: 54
iTrader: 0 / 0%
 

Chad is on a distinguished road

  Old  javascript error: 'undefined'

A while ago I was searching for a random quote javascript tool and found one. Not sure who the author is to be honest. However, I set it up on www.talkjesus.com and the random quotes all work fine, except once in every handful of random quotes I get only a 'undefined'. I'm guessing there is a certain character in one of the lines that is not js friendly. I would not know since I'm not a coder, so I'm asking for your help please.

This is the code

Code:
var Quotation=new Array() // do not change this!

Quotation[1] = "Use the Preview Post button when posting a new thread or replying";
Quotation[2] = "Familiarize yourself with the site navigation menus on top";
Quotation[3] = "Try the Spy feature. Its shows you what threads members are viewing in real-time.";
Quotation[4] = "Pray first before giving counseling to others";
Quotation[5] = "Read Scripture daily. It is spiritual food.";
Quotation[6] = "Use our online Bible Glossary tool found under the Bible menu on top.";
Quotation[7] = "Break down your responses in easy to read, small paragraphs. Large paragraphs are a turn off to the audience.";
Quotation[8] = "The Bible is a book that is not for mere reading. It is a book for studying so that it can be applied.";
Quotation[9] = "We have a complete online bible. Click on Bible menu up top.";
Quotation[10] = "To love one's enemy does not mean to love the mire in which the pearl lies but to love the pearl that lies in the mire.";
Quotation[11] = "Invite your family, friends and church to our forums.";
Quotation[12] = "Proper paragraphing makes for better audience reading and responses.";
Quotation[13] = "When you feel down and going through tought trials, remember the countless great things Jesus has done for you!";
Quotation[14] = "Check out the entire Bible online in 17 translations and many additional resouces. Bible link on top menu.";
Quotation[15] = "Listen to music while browsing the site. Click on Radio & TV link under Entertainment menu. Opens a small pop-up window with various Christian worship stations of all sorts of genre.";
Quotation[16] = "You can invite everyone on your social mail or community contact list in one click! Click the Invite Friends link under the User CP menu on top.";
Quotation[17] = "Use the Save Draft button to save your post for later, without immediately publishing it.";

var Q = Quotation.length;
var whichQuotation=Math.round(Math.random()*(Q-1));
function showQuotation(){document.write(Quotation[whichQuotation]);}
showQuotation();
Example:

http://www.talkjesus.com/evidence-bi...rophecies.html

(pink box up top)

Thanks for your help.

Reply With Quote
04-17-2009, 11:55 AM
#2
hjalmar is offline hjalmar
Status: Senior Member
Join date: Nov 2004
Location: Sweden
Expertise:
Software:
 
Posts: 857
iTrader: 11 / 100%
 

hjalmar is an unknown quantity at this point

  Old

well yeah there is no 0.

Reply With Quote
04-17-2009, 02:16 PM
#3
hijax is offline hijax
Status: Junior Member
Join date: Apr 2009
Location:
Expertise:
Software:
 
Posts: 32
iTrader: 1 / 100%
 

hijax is on a distinguished road

  Old

Originally Posted by hjalmar View Post
well yeah there is no 0.
That's correct.

JavaScript always begins with zero "0" as it's first number.

Reply With Quote
Reply    


Currently Active Users Viewing This Thread: 1 (0 members and 1 guests)
 

  Posting Rules  
Smilies are On
[IMG] code is On
HTML code is Off
Forum Jump:
 
  Contains New Posts Forum Contains New Posts   Contains No New Posts Forum Contains No New Posts   A Closed Forum Forum is Closed