Page 1 of 2 12 LastLast
Results 1 to 10 of 14

Thread: Validate Fade-In Slideshow? & Opera Question, too

  1. #1
    Join Date
    Oct 2004
    Posts
    14
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Default Validate Fade-In Slideshow? & Opera Question, too

    Fade-In Slideshow

    http://www.dynamicdrive.com/dynamici...nslideshow.htm

    Love this script, but I have two questions:

    1.) As someone who sells web development services to small businesses, I feel that W3C validation is just one of those things you do for your client's websites as a mark of your professionalism. It's independent verification that you, at the very least, know what you're doing.

    Having said that, I've tried to get the above script to validate as XHTML 1.0 Transitional, and was able to resolve the easy issues like the lack of alt tags, but cannot figure out how to resolve the remaining issues, which may be seen here at the W3C site validator:

    http://validator.w3.org/check?verbos...vices/develop/

    Original page may be seen here:

    http://tesla-pc.com/services/develop/

    Any help would be greatly appreciated.

    2.) The script works terrifically in IE, Firefox and NS; in Opera it degrades to a regular slide show. It's not a big deal--as degradations go, this is a very acceptable one--but I'm cur
    ious to know if anyone's found a workaround.
    Last edited by sel_nyc; 02-16-2005 at 06:54 PM.

  2. #2
    Join Date
    Aug 2004
    Posts
    10,143
    Thanks
    3
    Thanked 1,008 Times in 993 Posts
    Blog Entries
    16

    Default

    Ok, try this instead:

    <script>
    // <[CDATA[
    "
    "
    // ]]>
    </SCRIPT>

    I tested it, and the slideshow still works on your page. The script should validate as a result still. Make sure you add the part in bold to both scripts on your page.
    Last edited by ddadmin; 02-17-2005 at 02:05 AM.

  3. #3
    Join Date
    Oct 2004
    Posts
    14
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Default Well...

    Yeah, now it's trying to parse the first bracket of the CDATA declaration as data instead of a character.

    But the slideshow works.

    How important is it that I place this tag around all of the js on my page?

    For example, this page:

    http://tesla-pc.com/resources/wallpapers/index.htm

    Also contains that little time/date thing on the bottom, plus a little js sniffer for the UA's screen resolution and it validates as XHTML 1.0 Transitional, as do all my other pages. I'm kind using this as, not really a selling point, 'cause --nothing against them--but my clients wouldn't know the difference, but as a way of demonstrating a level of proficiency in web design.

    Yeah, big frickin' deal.

    At any rate, the material I've read seems to indicate you'd use the CDATA tag just anywhere there was character data (cleverly named, ain't it) that you didn't want parse as anything but characters...or something.

    Those other scripts (I think one of them is yours) validate; I think I had to fiddle with 'em a bit, but they've offered no problem since.

    OK, getting hungry and confused now. Must eat.
    Last edited by sel_nyc; 02-17-2005 at 02:44 AM.

  4. #4
    Join Date
    Aug 2004
    Posts
    10,143
    Thanks
    3
    Thanked 1,008 Times in 993 Posts
    Blog Entries
    16

    Default

    No problem. BTW I've deleted the previous two posts just to avoid confusion by other people who may view this thread.

  5. #5
    Join Date
    Oct 2004
    Posts
    14
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Default

    OK, so we were, like, typing this at the same time, huh?

    Well, you were typing, I was editing. I just hadn't tersted the validation part before i spoke. Sorry about that.

  6. #6
    Join Date
    Aug 2004
    Posts
    10,143
    Thanks
    3
    Thanked 1,008 Times in 993 Posts
    Blog Entries
    16

    Default

    Hmmm so just to clarify, bottom line, does the page with the Fade In slideshow now validate?

    How important is it that I place this tag around all of the js on my page?
    I'm probably not the best person to ask this, since I'm not fully immersed in xhtml/ xml coding yet. If a script validates even without <[CDATA[, then most likely it happens to not contain any special characters of xhtml/ xml. In that case, is it necessary to still have <[CDATA[? Maybe in XML, not sure about xhtml, but if it validates, ultimately that should be your sign of approval.

  7. #7
    Join Date
    Oct 2004
    Posts
    14
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Default

    I'm sorry I didn't make that clearer in my previous post.

    No, it doesn't validate.

    As I just validated all my sites last month--sort of on a whim and because the things that kept them from validating were so relatively easy to fix--I am by no means an expert on XML myself.

    So, to recap, with the original <[CDATA[ & ]]> tags, the page will validate but the slideshow doesn't work--degrades to, well, nothing.

    With the addition of the slashes, the slideshow works, but the page won't validate as XHTML 1.0 Transitional.

    After looking at the notations at the W3C site and elsewhere, I agree with you--this looks like it should work, though they don't specifically call for its use in a js scenario.

    My sense is that because the CDATA looks at the js as characters it disables it's very essence as dynamic code.

    There are other tags, <IGNORE> for example (which won't work, just an example), that I came across that I'll play with. We certainly can't be the first people to try to validate 100 lines of js.

    Of course, I'll post back here with whatever results I find.

    I think as newer browsers are released (IE 7 this summer, for example, according to Bill Gates yesterday), the trend is for them to be more standards-based and use less proprietary-based code as in years past--during the browser wars of the mid-90's, for example.

    So I think validation is going to become, pardon me for the bad pun, a more valid way of making web pages, which impacts on every piece of code on your site, as well.

    I'll let you know what I find out.

    sel_nyc
    Last edited by sel_nyc; 02-17-2005 at 04:39 AM.

  8. #8
    Join Date
    Aug 2004
    Posts
    10,143
    Thanks
    3
    Thanked 1,008 Times in 993 Posts
    Blog Entries
    16

    Default

    Ok, lets try this again:

    <script type="text/javascript">
    <!-- <![CDATA[

    rest of script

    // ]]> -->
    </script>

    I tried the above on a valid blank page with just a DHTML script, and it validates.

  9. #9
    Join Date
    Oct 2004
    Posts
    14
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Default By George, I think he's got it!

    Awwwl-riiiight!

    Yes, the script works and the page validates as XHTML 1.0 Transitional.

    Here's the page:

    http://tesla-pc.com/services/develop/

    And here are the validation results:

    http://validator.w3.org/check?verbos...vices/develop/

    Well done!

  10. #10
    Join Date
    Dec 2004
    Location
    UK
    Posts
    2,358
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Default

    Quote Originally Posted by ddadmin
    <script type="text/javascript">
    <!-- <![CDATA[

    rest of script

    // ]]> -->
    </script>
    The SGML comment delimiters are unnecessary. This has been true - for both script and style data - since third generation browsers dropped out of wide-spread use (which was several years ago). More to the point, with XHTML documents they are harmful: a conforming user agent will completely ignore any content within the delimiters.

    As far as the CDATA processing instructions are concerned, they are only useful for XHTML document served as XHTML. The site in question serves HTML[1].

    The only correct way to serve non-trivial script or style data is via an external file. This is especially important if that data is used in more than one document (which is the case here).

    Mike


    [1] To be frank, if you aren't serving XHTML as XHTML, you may as well be using plain HTML. If not, all you are doing is forcing the user agent to error-correct the entire document into HTML which does nothing more than waste processor cycles.

    In addition, if you're going to take the time to use a more "modern" mark-up language, you could at least use more modern mark-up: the Transitional DTD in both XHTML and HTML is simply a stop-gap measure for legacy documents that use deprecated features. Any document authored in the last couple of years should be using a Strict DTD and not HTML 3.2 techniques like layout-tables.

Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •