Results 1 to 2 of 2

Thread: How to get gallery script to validate?

  1. #1
    Join Date
    Dec 2008
    Posts
    4
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Default How to get gallery script to validate?

    1) Script Title: Advanced Gallery script

    2) Script URL (on DD): http://www.dynamicdrive.com/dynamicindex17/agallery.htm

    3) Describe problem: Will not validate at W3C. The validator will not accept the subject attribute.

    Any way to get this to validate other than not using it?

    I have used the script for some time, but someone recently pointed out to me that it causes my pages to fail validation at W3C.

    Thanks,

  2. #2
    Join Date
    Feb 2008
    Location
    Cebu City Philippines
    Posts
    1,160
    Thanks
    17
    Thanked 277 Times in 275 Posts

    Default

    The problem is that subject is not a valid attribute which fails validation.

    Better yet, replace it with title instead:
    Code:
    <div class="gallerycontent" subject="What is JavaScript?">
    .
    .
    .
    <div class="gallerycontent" subject="Java & JavaScript Differences">
    .
    .
    .
    <div class="gallerycontent" subject="What is DHTML?">
    ...and change highlighted into title:
    Code:
    for (i=0;i<totalDivs;i++){
    var thesubject=partscollect[i].getAttribute("subject")
    ...and if you're serving your page as XHTML, then you should surround your script into CDATA islands, or better call it externally.

    Hope that makes sense.
    Learn how to code at 02geek

    The more you learn, the more you'll realize there's much more to learn
    Ray.ph!

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
  •