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

Re: [jslint] JSLint and HTML

Expand Messages
  • IcedNet Development Team
    So a single zip with 3 files (html, css, js) is out of the question? How do they deal with images? Text only? Wow, I have some flaky clients, but that is def
    Message 1 of 13 , Mar 21, 2013
    • 0 Attachment
      So a single zip with 3 files (html, css, js) is out of the question? How do they deal with images? Text only?
      Wow, I have some flaky clients, but that is def in the top 5... :D
      Good luck.

      Peace,
      Dan

      On 2013/03 /21, at 11:37 AM, hemanrobinson wrote:

      > For our project, embedding JavaScript in HTML is not bad practice. In fact, there is no alternative. We are required to produce a single output file.
      >
      > The reason is, our customers email these files, and post them to their corporate intranets. Our customers are not stupid, but neither do they want the hassle of managing multiple files, or arguing with their IT folks about how those files should be deployed.
      >
      > We have been delighted with JSLint for several years. Please give us an option to retain this feature. Thanks!
      >
      > --- In jslint_com@yahoogroups.com, "douglascrockford" <douglas@...> wrote:
      > >
      > > When I began JSLint in 2001, the usual practice in web applications was to include inline scripts and event handlers in HTML. So JSLint includes an HTML parser so that it can locate and inspect the embedded scripts.
      > >
      > > Since then, we have determined that embedding JavaScript in an HTML file is a very bad practice. It is bad from a performance standpoint because gzip and caching are not possible. It is bad from a security standpoint because of the XSS hazard. CSP cannot be effective unless you strictly follow the good practice of segregating scripts.
      > >
      > > Since the purpose of JSLint is to promote good practice, I will be removing JSLint's HTML parser.
      > >
      >
      >



      [Non-text portions of this message have been removed]
    • Felix E. Klee
      On Thu, Mar 21, 2013 at 3:37 PM, hemanrobinson ... Good practice is to use separate files during development, and then
      Message 2 of 13 , Mar 21, 2013
      • 0 Attachment
        On Thu, Mar 21, 2013 at 3:37 PM, hemanrobinson <hemanrobinson@...>
        wrote:
        > For our project, embedding JavaScript in HTML is not bad practice. In
        > fact, there is no alternative. We are required to produce a single
        > output file.

        Good practice is to use separate files during development, and then
        (automatically) merge them together for deployment.
      • falk.werner@rocketmail.com
        ... Is it good practice to only check parts of a product and not the assembled product ( a single output file ) itself?
        Message 3 of 13 , Mar 21, 2013
        • 0 Attachment
          > Good practice is to use separate files during development, and then
          > (automatically) merge them together for deployment.

          Is it good practice to only check parts of a product and not the assembled product ("a single output file") itself?
        • Andrew Todd
          ... You will be better off moving to a build and templating system that pulls in your JavaScript source files and your HTML templates, checks them separately,
          Message 4 of 13 , Mar 22, 2013
          • 0 Attachment
            On Thu, Mar 21, 2013 at 11:37 AM, hemanrobinson <hemanrobinson@...>wrote:

            > **
            > For our project, embedding JavaScript in HTML is not bad practice. In
            > fact, there is no alternative. We are required to produce a single output
            > file.
            >

            You will be better off moving to a build and templating system that pulls
            in your JavaScript source files and your HTML templates, checks them
            separately, does any minifying you want, and then combines them together.
            In this way, you are using tools designed for their tasks.

            I use Maven, the JSLint Maven plugin, and the Freemarker preprocessor Maven
            plugin for this purpose.


            [Non-text portions of this message have been removed]
          • hemanrobinson
            Thanks for all the advice. We have found a workaround. I am sorry to lose the HTML parsing; it was a useful feature.
            Message 5 of 13 , Mar 25, 2013
            • 0 Attachment
              Thanks for all the advice. We have found a workaround.

              I am sorry to lose the HTML parsing; it was a useful feature.


              --- In jslint_com@yahoogroups.com, Andrew Todd <andrew.todd659@...> wrote:
              >
              > On Thu, Mar 21, 2013 at 11:37 AM, hemanrobinson <hemanrobinson@...>wrote:
              >
              > > **
              > > For our project, embedding JavaScript in HTML is not bad practice. In
              > > fact, there is no alternative. We are required to produce a single output
              > > file.
              > >
              >
              > You will be better off moving to a build and templating system that pulls
              > in your JavaScript source files and your HTML templates, checks them
              > separately, does any minifying you want, and then combines them together.
              > In this way, you are using tools designed for their tasks.
              >
              > I use Maven, the JSLint Maven plugin, and the Freemarker preprocessor Maven
              > plugin for this purpose.
              >
              >
              > [Non-text portions of this message have been removed]
              >
            Your message has been successfully submitted and would be delivered to recipients shortly.