Results 1 to 5 of 5

Thread: script lacking { 's can be a source for errors validating xhtml?

  1. #1
    Join Date
    Oct 2007
    Posts
    38
    Thanks
    4
    Thanked 0 Times in 0 Posts

    Default script lacking { 's can be a source for errors validating xhtml?

    1) Script Title: Dynamic Ajax Content

    2) Script URL (on DD): http://www.dynamicdrive.com/dynamici...jaxcontent.htm

    3) Describe problem: i cant validate my xhtml webpage & the errors are comming from the javascript code

    basicly thats the problem.

    ...

    when i validate a xhtml webpage, i get allot of errors comming from the javascript.

    i noticed theres a lack of { and } so im wondering if that affects the validation.

    thanks
    ric

    edit:

    i just made a direct validation of the script which i downloaded and did not edit and the XHTML and its gives out errors

    the reason im pointing this out is because im having trouble setting some height attributes in css to a few tables and i wanted to make sure the website had no errors before i looked into the situation, but im finding errors on the original script provided...

    ric
    Last edited by ricmetal; 11-15-2007 at 02:10 AM.

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

    Default

    Wrap the script on the page with a CDATA tag as discussed on this page: http://www.dynamicdrive.com/style/bl...tml-compliant/

  3. #3
    Join Date
    Mar 2005
    Location
    SE PA USA
    Posts
    30,495
    Thanks
    82
    Thanked 3,449 Times in 3,410 Posts
    Blog Entries
    12

    Default

    Quote Originally Posted by ddadmin View Post
    Wrap the script on the page with a CDATA tag as discussed on this page: http://www.dynamicdrive.com/style/bl...tml-compliant/
    That is one of several methods. You probably shouldn't be using an XHTML DOCTYPE to begin with, and removing it in favor of:

    Code:
    <!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01//EN" "http://www.w3.org/TR/html4/strict.dtd">
    However, that alone will not solve many of the possible 'on page' javascript errors generated by the validator. Opinions vary as to the correctness of these error reports. They may all be eliminated though by making the script an external one.
    - John
    ________________________

    Show Additional Thanks: International Rescue Committee - Donate or: The Ocean Conservancy - Donate or: PayPal - Donate

  4. #4
    Join Date
    Oct 2007
    Posts
    38
    Thanks
    4
    Thanked 0 Times in 0 Posts

    Default

    thanks ddadmin..


    jscheuer1, i tried allot of different doctypes, all give errors so im just gonna change doctypes as i add code to the page.

    fortunately my height problem had nothing to do with the javascript not being validated ('few'!)

    thanks for ur help.

    ric

  5. #5
    Join Date
    Mar 2005
    Location
    SE PA USA
    Posts
    30,495
    Thanks
    82
    Thanked 3,449 Times in 3,410 Posts
    Blog Entries
    12

    Default

    I never said the DOCTYPE was the problem. I only said that you probably shouldn't be using an XHTML DOCTYPE. Separately I mentioned that there are several ways to 'validate' (actually to validate a page with javascript, validating javascript as javascript is another matter entirely) javascript, and that the best method is generally to make the script external.
    - John
    ________________________

    Show Additional Thanks: International Rescue Committee - Donate or: The Ocean Conservancy - Donate or: PayPal - Donate

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
  •