PDA

View Full Version : DHTML Ticker Script Issue



peoplestring
05-03-2011, 06:42 PM
1) Script Title: DHTML Ticker Script

2) Script URL (on DD): http://www.dynamicdrive.com/dynamicindex2/generaltick.htm

3) Describe problem: In the code, in order to post a new piece of ticker content, I must use this code:

tickercontent[0]='<a href="http://www.javascriptkit.com">JavaScript Kit</a><br />Comprehensive JavaScript tutorials and over 400+ free scripts!'

If I need to surround the code with ' , then anytime I enter ' in the content itself it ends the code. This means that I can't show possession in the ticker content! E.g. If I enter "My dog's coat is shiny", the ' in dog's ends the ticker content. Am I totally missing what I need to do here? Thank you in advance for any help!

ddadmin
05-04-2011, 06:15 AM
Simply use a backslash (\) to escape any character inside a JavaScript string that may be interpreted differently given the context. So in this case, you'd use it like in the following:


tickercontent[0]='I\'m the king of the world you\'re right!'