Loading ...
Sorry, an error occurred while loading the content.

checking HTML

Expand Messages
  • Mark Volkmann
    I see there is an option to allow HTML to contain a fragment instead of a full document. I know how to specify JSLint options in a comment at the top of a
    Message 1 of 5 , Feb 6, 2010
    • 0 Attachment
      I see there is an option to allow HTML to contain a fragment instead of a full document. I know how to specify JSLint options in a comment at the top of a JavaScript file, but can the same thing be done at the top of a .html file? I tried using an HTML comment, but it seems that JSLint doesn't allow any kind of comment before the root element. That in itself seems wrong.
    • Cheney, Edward A SSG RES USAR USARC
      Mark, Do you mean JSLint s fragment: true option? Please describe your use case with greater specification when you refer to use at top of a HTML file. Austin
      Message 2 of 5 , Feb 7, 2010
      • 0 Attachment
        Mark,

        Do you mean JSLint's fragment: true option? Please describe your use case with greater specification when you refer to use at top of a HTML file.

        Austin

        ----- Original Message -----
        From: Mark Volkmann <r.mark.volkmann@...>
        Date: Saturday, February 6, 2010 18:19
        Subject: [jslint] checking HTML
        To: jslint_com@yahoogroups.com


        > I see there is an option to allow HTML to contain a fragment
        > instead of a full document. I know how to specify JSLint options
        > in a comment at the top of a JavaScript file, but can the same
        > thing be done at the top of a .html file? I tried using an HTML
        > comment, but it seems that JSLint doesn't allow any kind of
        > comment before the root element. That in itself seems wrong.
        >
      • Mark Volkmann
        Yes, I mean the fragment: true option. I was looking for a way to break a large .html file up into pieces that get included into a main .html file. For
        Message 3 of 5 , Feb 7, 2010
        • 0 Attachment
          Yes, I mean the "fragment: true" option. I was looking for a way to break a
          large .html file up into pieces that get included into a main .html file.
          For example, when using tabs from jQuery UI, it would be nice to put the
          code for each tab in a separate .html file and then include them into the
          main .html file. In that case the files being included would be HTML
          fragments since the html, head and body tags would only be needed in the
          main .html file. I had planned to stitch them together with server-side
          includes. I didn't want JSLint to complain about each of the fragment files,
          so I was looking for a way to specify "fragment: true" for the fragment
          .html files.

          I'm open to suggestions on how to best accomplish this. At that moment I
          have it working using the jQuery load function.

          On Sun, Feb 7, 2010 at 4:23 AM, Cheney, Edward A SSG RES USAR USARC <
          austin.cheney@...> wrote:

          >
          >
          > Mark,
          >
          > Do you mean JSLint's fragment: true option? Please describe your use case
          > with greater specification when you refer to use at top of a HTML file.
          >
          > Austin
          >
          >
          > ----- Original Message -----
          > From: Mark Volkmann <r.mark.volkmann@...<r.mark.volkmann%40gmail.com>
          > >
          > Date: Saturday, February 6, 2010 18:19
          > Subject: [jslint] checking HTML
          > To: jslint_com@yahoogroups.com <jslint_com%40yahoogroups.com>
          >
          > > I see there is an option to allow HTML to contain a fragment
          > > instead of a full document. I know how to specify JSLint options
          > > in a comment at the top of a JavaScript file, but can the same
          > > thing be done at the top of a .html file? I tried using an HTML
          > > comment, but it seems that JSLint doesn't allow any kind of
          > > comment before the root element. That in itself seems wrong.
          > >
          >
          >
          >



          --
          R. Mark Volkmann
          Object Computing, Inc.


          [Non-text portions of this message have been removed]
        • Cheney, Edward A SSG RES USAR USARC
          If your HTML fragment contains incomplete tag pairs, such starting code in this fragment and closing the block in another fragment, JSLint will report errors.
          Message 4 of 5 , Feb 7, 2010
          • 0 Attachment
            If your HTML fragment contains incomplete tag pairs, such starting code in this fragment and closing the block in another fragment, JSLint will report errors. If your fragment is fully inclusive you can push your fragment through an empty HTML template to simulate a full page. Such a template example could be:

            <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd"><html lang="en" xmlns="http://www.w3.org/1999/xhtml"><head><title>x</title> <meta http-equiv="content-type" content="text/html;charset=UTF-8"/></head><body>
            <!-- your code here -->
            </body></html>
          • Mark Volkmann
            Thanks! I can see that approach will work, but what s the point of the fragment option if you have to do that? My HTML fragments do not contain incomplete tag
            Message 5 of 5 , Feb 8, 2010
            • 0 Attachment
              Thanks! I can see that approach will work, but what's the point of the
              fragment option if you have to do that? My HTML fragments do not contain
              incomplete tag pairs. They just don't have html, head and body tags.

              On Sun, Feb 7, 2010 at 10:20 PM, Cheney, Edward A SSG RES USAR USARC <
              austin.cheney@...> wrote:

              >
              >
              > If your HTML fragment contains incomplete tag pairs, such starting code in
              > this fragment and closing the block in another fragment, JSLint will report
              > errors. If your fragment is fully inclusive you can push your fragment
              > through an empty HTML template to simulate a full page. Such a template
              > example could be:
              >
              > <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN" "
              > http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd"><html lang="en" xmlns="
              > http://www.w3.org/1999/xhtml"><head><title>x</title> <meta
              > http-equiv="content-type" content="text/html;charset=UTF-8"/></head><body>
              > <!-- your code here -->
              > </body></html>
              >
              >



              --
              R. Mark Volkmann
              Object Computing, Inc.


              [Non-text portions of this message have been removed]
            Your message has been successfully submitted and would be delivered to recipients shortly.