Welcome to WebmasterWorld Guest from 54.159.165.175

Forum Moderators: open

W3C Validation Errors

''required attribute "type" not specified''

   
8:21 pm on May 17, 2010 (gmt 0)

5+ Year Member



Hi there, just checking my site through the W3C validator, it seams to be coming up with 2 javascript errors, i've checked through the coding and the error seams to be coming from the 'Twitter' widgit I have on the page (see below)the error marked in bold is whats coming up as wrong, can anyone help?
Thanks, James.

<script src="http://widgets.twimg.com/j/2/widget.js"></script>
<script>

new TWTR.Widget({
version: 2,
type: 'profile',
rpp: 3,
interval: 6000,
width: 325,
height: 100,
theme: {
shell: {
background: '#333333',
color: '#ffaa00'
},
tweets: {
background: '#000000',
color: '#ff9900',
links: '#c7c7c7'
}
},
features: {
scrollbar: false,
loop: false,
live: false,
hashtags: true,
timestamp: true,
avatars: false,
behavior: 'all'
}
}).render().setUser('furiousdesigns').start();
</script>

.............................................................

Line 117, Column 94: required attribute "type" not specified
48" valign="top"><script src="http://widgets.twimg.com/j/2/widget.js"></script>

The attribute given above is required for an element that you've used, but you have omitted it. For instance, in most HTML and XHTML document types the "type" attribute is required on the "script" element and the "alt" attribute is required for the "img" element.

Typical values for type are type="text/css" for <style> and type="text/javascript" for <script>.

Line 118, Column 22: required attribute "type" not specified
<script>
The attribute given above is required for an element that you've used, but you have omitted it. For instance, in most HTML and XHTML document types the "type" attribute is required on the "script" element and the "alt" attribute is required for the "img" element.

Typical values for type are type="text/css" for <style> and type="text/javascript" for <script>.
8:30 pm on May 17, 2010 (gmt 0)

WebmasterWorld Senior Member themadscientist is a WebmasterWorld Top Contributor of All Time 5+ Year Member Top Contributors Of The Month



You're missing exactly what it says ;)

<script src="http://widgets.twimg.com/j/2/widget.js" type="text/javascript"></script>
<script type="text/javascript">
8:30 pm on May 17, 2010 (gmt 0)

5+ Year Member



You have the answer in the last line of your post :)

Instead of:
<script src="http://widgets.twimg.com/j/2/widget.js"></script>
<script>

Use:
<script type="text/javascript" src="http://widgets.twimg.com/j/2/widget.js"></script>
<script type="text/javascript">
8:33 pm on May 17, 2010 (gmt 0)

5+ Year Member



<?php echo 'there's an echo in here'; ?>

;)
8:33 pm on May 17, 2010 (gmt 0)

WebmasterWorld Senior Member 5+ Year Member



Hi Jimbo123 and welcome to WebmasterWorld [webmasterworld.com]

The answer is right there:
the "type" attribute is required on the "script" element [..] Typical values for type [..] type="text/javascript" for <script>.

In other words, change the first two lines as follows:

<script src="http://widgets.twimg.com/j/2/widget.js" type="text/javascript"></script>
<script type="text/javascript">

Are you sure you need to validate your document as XHTML? HTML 4.01 is more permissive and seems to be generally recommended by other posters here.

Edit: Wow! We're a helpful bunch :)
8:43 pm on May 17, 2010 (gmt 0)

5+ Year Member



Hi Guys, thanks so much for all your help!Feel a bit of a numpty I didnt notice that before haha. :D

In regards to using XHTML instead of HTML 4.01 It's just the one that poped up when I first validated a CSS, it came as a 'Recomended link' from W3C. Is it better to use HTML 4.01 then?

Cheers.
8:47 pm on May 17, 2010 (gmt 0)

5+ Year Member



Is it better to use HTML 4.01 then?

The answer is 'almost always: Yes!'

See Why most of us should NOT use XHTML [webmasterworld.com]
8:58 pm on May 17, 2010 (gmt 0)

WebmasterWorld Senior Member themadscientist is a WebmasterWorld Top Contributor of All Time 5+ Year Member Top Contributors Of The Month



Is it better to use HTML 4.01 then?

If you want to be ahead of the game you might look at HTML 5 too...

@ lavazza... LOL. I was clicking submit as fast as I could!
 

Featured Threads

My Threads

Hot Threads This Week

Hot Threads This Month