Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations derfloh on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

can someone look at my news ticker? it won't work

Status
Not open for further replies.

cheddylove

Technical User
Nov 6, 2006
11
IE
hey all,

i am totally useless at this but have been asked to insert a news ticker onto a site that i am designing and have been playing about with one but can't get it to work.

i am very new to all this so please excuse my stupidity. i know it is probably something really silly i've done that is not allowing it to work. would someone mind having a look?

 
errors from firefox's error console:

Code:
Error: unterminated string literal
Source File: [URL unfurl="true"]http://www.shaunlafferty.com/redesign/index.htm[/URL]
Line: 38, Column: 12
Source Code:
            '<li>fhersjt

Code:
Error: start is not defined
Source File: [URL unfurl="true"]http://www.shaunlafferty.com/redesign/index.htm[/URL]
Line: 1

your javascript multi-line code should be something like this:

Code:
var myVar = 'blah';
myVar += ' hi';
myVar += ' something';



*cLFlaVA
----------------------------
[tt]"quote goes here"[/tt]
[URL unfurl="true"]http://www.coryarthus.com/[/url]
 
thanks cLFlaVA

i'm really sorry, but i meant it when i said i am useless at this! i don't know what you are saying i need to do..

perhaps i would be better just admitting defeat. i really don't understand javascript. this was copied and pasted from a ticker generator. i thought that i just had pasted something in the wrong place! but are you saying that the code generated is wrong?
if so is there a better generator i could purchase on line that you could advise that can be used with css? oh and is fool-proof :(
 
Take the first example, the "unterminated string"... The means that you have a string that isn't terminated, at line 38 of "idnex.htm":

Code:
'<li>fhersjt
39
40yui</li>'+

As you can see, the problem is you have a line break in the middle of a string, which is not allowed.

you need to correct all occurrences of this (simply view the page source to see all of them).

Hope this helps,
Dan

Coedit Limited - Delivering standards compliant, accessible web solutions

[tt]Dan's Page [blue]@[/blue] Code Couch
[/tt]
 
that worked! cheers dan!

thank you both for your time!
 
hi guys,

could i ask one more favour? ;)

i have been trying to validate my code and can't fix some of the errors due to my lack of knowledge/experience...

In relation to the LI and A errors, i just can't see what i am doing wrong.

Also the javascript and body errors have me totally baffled, i know the body one needs to be somewhere else or merged with the existing body element but just don't know how or which..

could someone have a squiz and get back to me?


cheers
 
Re. the "body" error - you have 2 bodies... simply remove the second, erroneous one (you may want to move the onload to the first, correct one).

Incidentally, consider using a "text-transform: uppercase" style for your nav links, rather than making the text all uppercase. It's a lot, lot neater, IMHO.

Dan



Coedit Limited - Delivering standards compliant, accessible web solutions

[tt]Dan's Page [blue]@[/blue] Code Couch
[/tt]
 
thanks a mill

like this: <body id="container" onload="start();"> ?

sorry, i am a total novice-cut'n'paster! a designer for ages using WYSIWYG but now trying to do stuff properly.

any ideas on the li and a errors? they look open to me...
 
your script tags should look like this:

Code:
<script type="text/javascript"><!--
  ...
  ...
  ...
//--></script>

language="JavaScript" is deprecated. Also, notice the HTML comment tags I've included - they tell the browser not to interpret code in between them as HTML.



*cLFlaVA
----------------------------
[tt]"quote goes here"[/tt]
[URL unfurl="true"]http://www.coryarthus.com/[/url]
 
crap.. i take it that is why i'm getting those li etc. errors..
 
like this: <body id="container" onload="start();"> ?

Try it and find out... if you learn by trying, you'll pick things up so much more than being told...

Dan



Coedit Limited - Delivering standards compliant, accessible web solutions

[tt]Dan's Page [blue]@[/blue] Code Couch
[/tt]
 
after a few hours of attempting to fix this i have only added to the number of errors i originally had.. i have just decided that i don't have the skill to do this, which why i was using a "generator" in the first place. I thought it was just going to be a case of pasting the code into my page..

thank you both for your help and patience and pointing me in the right direction!
 
amazingly"?? that seems to be laced with implication.
i was testing locally.
 
ah, that would make sense.

what other errors are you getting? cleaning these errors is relatively straight-forward, and more often than not fixing the top one also fixes many others...

we're not unwilling to help you. not with a name like "cheddy love".



*cLFlaVA
----------------------------
[tt]"quote goes here"[/tt]
[URL unfurl="true"]http://www.coryarthus.com/[/url]
 
more or less the bloody same ones as i am too scared to change too much, incase i unravel it so much can't fix it. i have been looking at the source code of loads of sites and comparing mine to theirs and changing bits - testing - changing - test, etc. ect. but getting nowhere. i am the coding equivelent of a person afraid to touch a mouse on a computer for fear it'll blow up!

i am just so fed up now. i think i need to take a step back and come back to it later. i still have lovely cgi to learn this afternoon!! i fear i may have taken on too much..

i NEED a gin and tonic!
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top