PDA

View Full Version : Validation problem



jr3
06-30-2009, 07:51 PM
1) Script Title: Ultimate Fade-in Slideshow

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

3) The problem: I cant get this script to validate! http://validator.w3.org/

The website is www.classymannequins.com. What am I doing wrong?

Thanks for any help you can offer...

traq
06-30-2009, 07:55 PM
you're probably not doing anything wrong. Does the script work? Does your page validate without the script? If so, don't worry too much. Most DD scripts don't, and won't, validate (especially if you're using an html doctype; most were written with self-closing tags, etc.).

jr3
07-01-2009, 04:36 PM
traq,

Yes, the page validates without the script. In fact the whole site validates without the script. That why I was so bummed out when I found out the script makes it invalid--I spent so much time initially trying to make my side validate and once I did, it was ruined by this beautiful slideshow script. Yes, the script works perfectly.

I'm new to HTML/CSS/DHTML, so I'm curious...what--if any--are the repercussions of a website/page not validating?

Thanks!

traq
07-02-2009, 03:46 AM
this probably won't have any serious repercussions. Valid code is best, but almost all of the internet -many large, professional, and/or popular sites, including the page we're on (http://validator.w3.org/check?verbose=1&uri=http%3A%2F%2Fwww.dynamicdrive.com%2Fforums%2Fshowthread.php%3Fp%3D200063%23post200063)- isn't "valid." And if it's *working*, your users will likely never notice a difference anyway. I'm not saying that you shouldn't aspire to write valid code -being new to html, that's awesome that you would choose to, and it will prove very beneficial- but don't blow a gasket over not having it. I know some people here are going to jump up and pound me into the ground for saying so :D, but sometimes it doesn't cause any harm.

If you would like to keep your page "valid," you could try saving the javascript code into external files and just calling them from the page, instead of actually writing them on the page. I do this anyway, especially with longer scripts, just to keep my pages uncluttered. For example:



page.html

<html>
<head>
<script type="text/javascript" src="slideshow_head.js"></script>
</head>
<body>
<!--other content...-->
<script type="text/javascript" src="slideshow_body.js"></script>
<!--other content...-->
</body>
</html>


slideshow_head.js

/***********************************************
* Ultimate Fade-In Slideshow (v1.51): Dynamic Drive (http://www.dynamicdrive.com)

//script code continues...


slideshow_body.js

//new fadeshow(IMAGES_ARRAY_NAME, slideshow_width, slideshow_height, borderwidth, delay, pause (0=no, 1=yes), optionalRandomOrder)
new fadeshow(fadeimages, 140, 225, 0, 3000, 1, "R")
new fadeshow(fadeimages2, 140, 225, 0, 3000, 0)

jr3
07-02-2009, 09:00 AM
Very helpful informaton. Thank you traq. I like your idea of saving the JS to an external file. Very clever :)