PDA

View Full Version : Ultimate Fade-in slideshow (v1.5) : some htmlerrors and warnings



SpaceBoy
04-03-2007, 08:57 PM
1) Script Title: Ultimate Fade-in slideshow (v1.5)

2) Script URL (on DD): http://www.dynamicdrive.com/dynamicindex14/fadeinslideshow.htm

3) Describe problem: I have implements this very nice script on my website and it works perfectly :) . However, my FF extension HTMLTidy gives me about ~30 errors and warning on the js code for example :

* line 478 column 400 - Error: character "'" is not allowed in the value of attribute "ID"
* line 482 column 15 - Warning: cannot generate system identifier for general entity "dom"
* line 482 column 15 - Error: general entity "dom" not defined and no default entity
* line 482 column 18 - Error: reference to entity "dom" for which no system identifier could be generated
* line 493 column 25 - Warning: cannot generate system identifier for general entity "obj.tempobj.filters"
* line 493 column 25 - Error: general entity "obj.tempobj.filters" not defined and no default entity
* line 509 column 62 - Error: element "OBJ.POSTIMAGES.LENGTH-1" undefined
* ...

I'm using doctype html 4.01 transitional loose.dtd.

Anyone has the same errors ?

SpaceBoy
04-03-2007, 09:11 PM
You know what ? I've added the js code between the <head> tags of my page and all errors are gone. There seems to be a difference if the slideshow code is defined in the html header or in the body.

Anyone knows why ? :o

jscheuer1
04-03-2007, 09:17 PM
The vagaries of the error checker. Opinions vary but, mine is that since the code is javascript, the error checker shouldn't parse it as HTML anyway, no matter where it is placed in the page, as long as it is within a valid <script> tag. Ideally, all scripts should be external. Either way though, the real important part is that your scripts are valid, correct, well written script code and are inserted using valid tags.

SpaceBoy
04-03-2007, 09:53 PM
I could not find any valid errors as detected by the parser. It thinks it is html :p

Well, I have put all the script code in an external javascript file called "slideshow.js" and called it in the html header like :


<script type="text/javascript" src="includes/javascript/slideshow.js"></script>

..poef..all parsing errors & warnings gone...life can be cool sometimes :cool:

Thanks for the comment..

Didier.

jscheuer1
04-04-2007, 04:11 AM
To be in compliance with DD's usage terms, you must include the script credit on the page, ex:


<script type="text/javascript" src="includes/javascript/slideshow.js">
/***********************************************
* Ultimate Fade-In Slideshow (v1.5): Dynamic Drive (http://www.dynamicdrive.com)
* This notice MUST stay intact for legal use
* Visit http://www.dynamicdrive.com/ for this script and 100s more.
***********************************************/
</script>

SpaceBoy
04-04-2007, 03:22 PM
Thanks for the remark. I've added the credits inside the external javascript but not in the calling page. I will add it also there !

I have to read those DD's terms someday :)

Didier.