views:

40

answers:

4
Line 207, Column 50: Required attributes missing on element script.

   <script type="text/javascript" charset="utf-8">

Element-specific attributes for element script:
    Global attributes
    src
    async
    defer
    type
    charset 

What is it that I am missing? Thankyou

Edit: This is for all of my handwritten code, I don't want it connecting to an external js file

A: 

Seams legit. Maybe something to do with what you have inside the <script>?

Content model:
If there is no src attribute, depends on the value of the type attribute, but must match script content restrictions.

Frankie
Ahh I solved it. I just had to remove the charset attribute... I don't understand why! :) Thanks though
cat
@cat: You should have posted this as an **answer**. In HTML5 you can by the way also omit the `type` attribute. It implicitly defaults to `text/javascript` then.
BalusC
A: 

See this piece of the XHTML strict DTD

<!ELEMENT script (#PCDATA)>
<!ATTLIST script
  id          ID             #IMPLIED
  charset     %Charset;      #IMPLIED
  type        %ContentType;  #REQUIRED
  src         %URI;          #IMPLIED
  defer       (defer)        #IMPLIED
  xml:space   (preserve)     #FIXED 'preserve'
  >

The only required attribute is type. The problem lies in another part of your code, please paste it here.

Pablo Fernandez
It's validating now, no errors or warnings. Maybe because it was checked as html5? I don't know, seems perfect now.
cat
A: 

works fine for me.. This document was successfully checked as HTML 4.0 Transitional!

Sandeep Singh Rawat
A: 

To fix it all I had to do was remove the charset attribute. :)

cat