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

Re: application/javascript

Expand Messages
  • sandyhead25
    Would it be possible to instead validate the necessary presence of the type attribute with an empty value. That way no value is supplied in accordance with
    Message 1 of 5 , May 20, 2009
    • 0 Attachment
      Would it be possible to instead validate the necessary presence of the type attribute with an empty value. That way no value is supplied in accordance with browser processing of JS and the attribute is still supplied for HTML validation.

      --- In jslint_com@yahoogroups.com, "pauanyu" <pcxunlimited@...> wrote:
      >
      > --- In jslint_com@yahoogroups.com, "Douglas Crockford" <douglas@> wrote:
      > >
      > > I recommend leaving out the type attribute entirely. All browsers always do the right thing when it is missing. Some of them fail, as you demonstrated, when it is present.
      > >
      > > Should JSLint complain about the type attribute?
      > >
      >
      > JSLint complains about the type property when used on a <script> tag that also has the src attribute, but doesn't complain when you put the type property on a <script> tag that doesn't have the src attribute.
      >
      > Personally, I agree with you, but unfortunately the type attribute is necessary for validation with the W3C, so not everybody will be so willing to get rid of the type attribute.
      >
    • pauanyu
      ... Indeed, that seems to work right. Interestingly enough, JSLint sees type= as perfectly okay, but type= text/javascript as wrong. Very peculiar.
      Message 2 of 5 , May 21, 2009
      • 0 Attachment
        --- In jslint_com@yahoogroups.com, "sandyhead25" <austin.cheney@...> wrote:
        >
        > Would it be possible to instead validate the necessary presence of the type attribute with an empty value. That way no value is supplied in accordance with browser processing of JS and the attribute is still supplied for HTML validation.
        >

        Indeed, that seems to work right. Interestingly enough, JSLint sees type="" as perfectly okay, but type="text/javascript" as wrong. Very peculiar.
      Your message has been successfully submitted and would be delivered to recipients shortly.