Why is this page invalid?

Collapse
This topic is closed.
X
X
 
  • Time
  • Show
Clear All
new posts
  • mark4asp

    Why is this page invalid?

    Why is this page invalid?

    Pasted into http://validator.w3.org/ I'm told that the page is
    invalid. Why? It flags problems with the <bodyand </htmltags but
    I can't see why. Is the W3C validator broke is or it my page? If it's
    my page then what's wrong with it?


    <!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Frameset//EN" "http://
    www.w3.org/TR/html4/frameset.dtd">
    <html>
    <head>
    <meta http-equiv="Content-Type" content="text/html; charset=utf-8">
    <title>my page - Login</title>
    <link href="images/login.css" rel="stylesheet " type="text/css">
    <script src="javascript/browser.js" type="text/javascript"></script>
    </head>

    <body>

    <!--start header - contains my page logo-->
    <div id="header">
    <span>A Logo</span><span id="nav">Home | <a
    href="contact.a spx">Contact</a></span>
    </div>
    <!--end header-->

    <!--start login - contains login box and photo-->
    <div id="login">

    <form method="post" id="frmMain" action="Default .aspx">
    <div id="divMain">
    <p class="subLogin ">Subscribe r Login</p>
    <p><label for="txtUserNam e">User Name</label><br>
    <input class="mwInput" size="16" name="txtUserNa me" id="txtUserName "
    type="text" title="Please enter text (do not cut and paste)"><br></p>

    <p><label for="txtAccessC ode">Access Code</label><br>
    <input class="mwInput" size="16" name="txtAccess Code"
    id="txtAccessCo de"
    onkeypress="if( event.keyCode== 13)validateLogi nDetails();"
    type="password" title="Please enter User and Access codes using
    correct letter case."></p>

    <div id="loginButton "><a id="loginButton A"
    href="javascrip t:validateLogin Details();"LOGI N </a></div>

    <p id="ForgotPWD"> <a href="contact.a spx?
    Action=ForgotPa ssword">Forgot Password</a></p>
    </div>
    </form>

    <img id="mainphoto" src="images/hd_photo.jpg" width="520" height="260"
    alt="two businessmen at a meeting"></div>
    <!--end login-->

    <!--start tickertape-->
    <div id="tickertape" >
    <iframe marginwidth="0" src="tickertape .aspx" marginheight="0 "
    frameborder="0" height="17" scrolling="no" width="750"></iframe>
    </div>
    <!--end tickertape-->

    <!--start main div - contains left and right columns and footer and
    centres content on the screen-->
    <div id="main">

    <!--start col1 - this is the lefthand column (services)-->
    <div id="col1">
    <h3>Subscriptio ns</h3>
    <h3>Services</h3>
    <h4>Newswire &amp; Database</h4>
    <h4>Watch</h4>
    <p>&nbsp;</p>
    <h4Analysis</h4>
    </div>
    <!--end col1 column-->

    <!--start col2 - this is the righthand column (welcome, etc.).
    Placed first in html code for SEO.
    CSS 'float' property is used to switch column position for layout
    purposes-->
    <div id="col2">

    <div class="col2cont 1">
    <h3>
    Some content</h3>
    </div>

    <div class="col2cont 1">
    <h3>
    Some more content</h3>
    </div>
    <div class="col2cont 2">&nbsp;</div>
    </div>

    <!--end col2 column-->

    <!--start footer-->
    <div id="footer">
    <p>A footer<a href="http://www.mypage.com" ></a></p>
    </div>
    <!--end footer-->

    </div>
    <!--end main div-->

    </body>
    </html>

  • Scott Bryce

    #2
    Re: Why is this page invalid?

    mark4asp wrote:
    Why is this page invalid?
    <html snipped>

    You are using a frameset doctype on a page that is not a frameset.

    Change the doctype to

    <!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN"
    "http://www.w3.org/TR/html4/loose.dtd">

    Then it will validate.


    Comment

    • Scott Bryce

      #3
      Re: Why is this page invalid?

      Beauregard T. Shagnasty wrote:
      ..and whether the page validates with either, will depend solely on
      the lack of errors. <g>
      I tried validating it as HTML 4.01 strict, and there were errors. I
      tried as HTML 4.01 transitional, and it validated.

      Using an HTML 4.01 strict doctype and correcting the errors would be
      preferred, but using an HTML 4.01 transitional doctype will work for the
      page in question.

      Comment

      • Simon Brooke

        #4
        Re: Why is this page invalid?

        in message <1182792638.870 136.16370@k79g2 000hse.googlegr oups.com>, mark4asp
        ('mark4asp@gmai l.com') wrote:
        Why is this page invalid?
        >
        Pasted into http://validator.w3.org/ I'm told that the page is
        invalid. Why? It flags problems with the <bodyand </htmltags but
        I can't see why. Is the W3C validator broke is or it my page?
        It's your page.
        If it's
        my page then what's wrong with it?
        You've specified the FRAMESET DTD. The FRAMESET DTD does not allow BODY.
        You want the STRICT DTD.

        --
        simon@jasmine.o rg.uk (Simon Brooke) http://www.jasmine.org.uk/~simon/
        ;; "If I were a Microsoft Public Relations person, I would probably
        ;; be sobbing on a desk right now" -- Rob Miller, editor, /.

        Comment

        • Dan

          #5
          Re: Why is this page invalid?


          mark4asp wrote:
          Is the W3C validator broke is or it my page?
          Out of curiosity, out of all the people who have asked this question
          on this newsgroup over the years, have *any* of their situations
          *ever* turned out to be a genuine case of the W3C validator being
          broken?

          --
          Dan

          Comment

          • Scott Bryce

            #6
            Re: Why is this page invalid?

            mark4asp wrote:
            Which is a real shame because iframes are so very useful for AJAX but
            I should try replacing it with an object.
            Huh?

            I don't have much experience with AJAX, but it seems to me that using
            AJAX should allow you to do the same things without iframes. AJAX should
            allow you to use a div in place of the iframe.

            Comment

            • Andy Dingley

              #7
              Re: Why is this page invalid?

              On 26 Jun, 16:04, Scott Bryce <sbr...@scottbr yce.comwrote:
              I don't have much experience with AJAX, but it seems to me that using
              AJAX should allow you to do the same things without iframes. AJAX should
              allow you to use a div in place of the iframe.
              AJAX only works if the content to be loaded is well-formed XML (which
              could be XHTML, so long as it _is_ well-formed).

              If you're trying to load non-XML HTML, or "typical" XHTML that isn't
              well-formed XML, then you have to stick with loading it into an
              <iframe>

              Comment

              • Scott Bryce

                #8
                Re: Why is this page invalid?

                Andy Dingley wrote:
                If you're trying to load non-XML HTML, or "typical" XHTML that isn't
                well-formed XML, then you have to stick with loading it into an
                <iframe>
                I have only done one AJAX project, and that wasn't my experience. I used
                AJAX specifically to avoid managing iframes, and I loaded HTML to avoid
                having to parse XML into HTML. By sending data to the page as HTML, I
                was able to write it directly into divs.

                So maybe what I was doing was AJAH?

                Comment

                • Andy Dingley

                  #9
                  Re: Why is this page invalid?

                  On Tue, 26 Jun 2007 11:57:24 -0600, Scott Bryce <sbryce@scottbr yce.com>
                  wrote:
                  >AJAX specifically to avoid managing iframes, and I loaded HTML to avoid
                  >having to parse XML into HTML. By sending data to the page as HTML, I
                  >was able to write it directly into divs.
                  So how did you load it?

                  Comment

                  • Scott Bryce

                    #10
                    Re: Why is this page invalid?

                    Andy Dingley wrote:
                    On Tue, 26 Jun 2007 11:57:24 -0600, Scott Bryce <sbryce@scottbr yce.com>
                    wrote:
                    >
                    >
                    >>AJAX specifically to avoid managing iframes, and I loaded HTML to avoid
                    >>having to parse XML into HTML. By sending data to the page as HTML, I
                    >>was able to write it directly into divs.
                    >
                    >
                    So how did you load it?
                    Well that is an interesting question, and not one I'm sure I can answer.
                    I used Perl's CGI::Ajax module to do a lot of the heavy work for me. The
                    CGI::Ajax module embeds the JavaScript that communicates with the server
                    into the web page. What that means is that it works, and I couldn't tell
                    you exactly how.

                    All I know is that I did what the docs for the CGI::Ajax module told me
                    to do. My perl script returns HTML, it is passed to a function where I
                    set the innerHTML of the div in question to the HTML that was returned,
                    and it works.

                    As I was reading up on AJAX, I didn't see anything that REQUIRED XML to
                    be sent to the web page. You can send any text string that your
                    JavaScript can parse into usable HTML.

                    It has been a while since I wrote it, and I may be remembering things
                    all wrong. As I mentioned, it is the only AJAX I have written. I don't
                    know much about it. What I do know is that I didn't use XML.

                    Comment

                    Working...