PDA

View Full Version : Scroller is causing lots-o-errors when i validate



mateoweb
09-29-2008, 08:47 PM
1) Script Title: Pausing up-down Scroller

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

3) Describe problem: i've got the script to work but when i try to validate the page - i have boat load of errors and they are almost all dealing with the scroller!
Lots of XML Parsing Errors, general entity X not defined and no default entity, etc, etc.

Has anyone experienced this? did i set it up wrong?
My Doctype is XHTML 1.0 Transitional.
Here's my page : http://www.marshall-legacy.org/index-new!.html

here's the page on WSC3 with the error codes : http://validator.w3.org/check?uri=http%3A%2F%2Fwww.marshall-legacy.org%2Findex-new!.html&charset=(detect+automatically)&doctype=Inline&group=1&user-agent=W3C_Validator%2F1.591

Any help would be greatly appreciated...
thanks,
Lisa

jscheuer1
09-30-2008, 05:49 AM
Make the script external.

mateoweb
09-30-2008, 06:31 PM
i made it an external js file but it's not loading. am i doing it wrong??? i made a new page to test : http://www.marshall-legacy.org/windex.html

and here's the js file: http://www.marshall-legacy.org/scripts/pscroller2.js

thanks for the suggestion BTW. I'd love it if this external could work. thanks in advance for any help!!!
-lisa

jscheuer1
09-30-2008, 08:23 PM
Get rid of (highlighted):


pausecontent2[2]='<a href="http://www.marshall-legacy.org/!our_dogs/dog-adopt.html">Click here for Info on how to Adopt Your OWN Mine Detection Dog</a>'
pausecontent2[3]='<a href="http://www.marshall-legacy.org/!news_and_events/donor_delegation_trip.html"> Donor Delegation Trip: Highlights here...</a>'


</script>

<script type="text/javascript">

/***********************************************
* Pausing up-down scroller- copyright Dynamic Drive (www.dynamicdrive.com)
* This notice MUST stay inta . . .

from the external script file.

There could be other problems, but that looks like all, and must be taken out.

Added Later:

There is another problem, this (on your page):


<div id="index_left_main"><div id="pscroller2">
<script language="javascript" type="text/javascript" src="../scripts/pscroller2.js">

//new pausescroller(name_of_message_array, CSS_ID, CSS_classname, pause_in_miliseconds)


document.write("<br />")
new pausescroller(pausecontent2, "pscroller2", "someclass", 3000)
</script></div>

should be:


<div id="index_left_main"><br />
<script type="text/javascript">

//new pausescroller(name_of_message_array, CSS_ID, CSS_classname, pause_in_miliseconds)
new pausescroller(pausecontent2, "pscroller2", "someclass", 3000);
</script>

mateoweb
10-01-2008, 01:46 PM
hi John - i REALLY appreciate your help! i did what you said, made the changes to the js file and then i made the changes to the page. the scroller is now in the page but if you take a look: http://www.marshall-legacy.org/windex.html
it has broken out of the container. i played around a bit, cleared the div. still it is funky. Oh - i also removed the </br> from the code you gsve me and that took away the float error. any suggestions????
thanks again,
-lisa

jscheuer1
10-01-2008, 03:17 PM
Though it just isn't right, it must be compensating for some other problem (perhaps even one I introduced by editing it incorrectly), so you can go back to what you had in the body before we made any changes:


<div id="index_left_main"><div id="pscroller2">
<script type="text/javascript">

//new pausescroller(name_of_message_array, CSS_ID, CSS_classname, pause_in_miliseconds)


document.write("<br />")
new pausescroller(pausecontent2, "pscroller2", "someclass", 3000)
</script></div>

In correcting an obvious error with it I may, as I say caused another less obvious one with more serious layout consequences, or the layout was flawed and the error corrected that, I can't tell right now which it is.

The obvious error is having the hard coded:


<div id="index_left_main"><div id="pscroller2">

because the script makes one too, and only one element per page per id is allowed.

But as I say, if taking it out messes things up, keep it and all the rest you had that was working there.

However, only for validation purposes, and only if there is still an error in validation, some changes may need to be made to it. Or perhaps it could be made into a small separate external script.

For example, this (though fine if it works out):


document.write("<br />")

may be causing validation problems. It could either be removed, or changed to:


document.write("<br \/>")

mateoweb
10-02-2008, 02:55 PM
hey john - i can't believe it but i got the darn thing to work. i went back to what it was before and then added the code that made the page all funky and took out the </br> so the new code looks like:
<div id="maincontent">
<div id="index_left_main"><div id="pscroller2">
<script type="text/javascript">

//new pausescroller(name_of_message_array, CSS_ID, CSS_classname, pause_in_miliseconds)
new pausescroller(pausecontent2, "pscroller2", "someclass", 3000);
</script></div>
also, i stripped out the clear divs. in any event the page works and looks as i wanted it to and now the only errors i have to deal with are the ones attributed to the flash movie!! 7 errors away from a clean page. thanks soooo much for helping me, i couldn't have done this without you.
-lisa