Is type="text/javascript" necessary?

<script type="text/javascript" src=""></script>

Some people add it, some people don’t.

It depends. What DOCTYPE does the page have?

1 Like

Worth reading -

1 Like
<?xml version="1.0" encoding="UTF-8" ?>
<!DOCTYPE html>
<html b:version='2' class='v2' expr:dir='data:blog.languageDirection' xmlns='' xmlns:b='' xmlns:data='' xmlns:expr=''>
  <b:if cond='data:blog.isMobile'>
    <meta content='width=device-width,initial-scale=1.0,minimum-scale=1.0,maximum-scale=1.0' name='viewport'/>
    <meta content='width=1100' name='viewport'/>
  <b:include data='blog' name='all-head-content'/>

Hi there asasass

what is your reasoning for using this…

<?xml version="1.0" encoding="UTF-8" ?>
<!DOCTYPE html>

Whatever it is, you should be aware
that it causes a validation error…

Error : Saw <? . Probable cause: Attempt to use an XML processing instruction in HTML. (XML processing instructions are not supported in HTML.) [At line 1, column 2]( ```<?xml version="1.0" encoding="UTF-8" ?>```


What does the Doctype read here?

Here is the result of the reading

14 errors and 7 warnings

…click the link for the actual details. :winky:

p.s. the document does not include…

<?xml version="1.0" encoding="UTF-8" ?>


Can you tell me how many errors this one has?

Nope. I’m on an iPad

Hi there asaasass,

it has a total of 74 errors and warnings*validation results


Hi there asaasass,

to validate pages yourself just bookmark this link…

…and pop the page location in the address bar. :winky:

It might supply hours of fun for you on a dull day. :biggrin:



Having 14 errors isn’t so bad then.

I’m better than Google.

[off topic]
I’m a great believer in validation for two main reasons.

Firstly, validated web pages have a far greater chance of rendering virtually the same on all web browsers. If the extra step of using Google Mobile Friendly validation then rendered output should be ok on all platforms.

Secondly, trying to render invalid web pages puts additional strain on web browsers because they have to guess what is trying to be achieved - this takes time and will result in web pages being slow to load.

[/off topic]



…might also be better than Google. :rofl:



That strikes me as rather like saying “I’m not so bad - I’ve only got two broken legs. That guy over there has four broken bones and a dislocated shoulder.”

Just because Google (or any other big site) uses invalid code is no reason to be complacent about having invalid code yourself.

1 Like

google may have errors that don’t effect anything much, your site may have errors that cause complete failure under certain circumstances. I was reading about the perils of putting certain things into the head section that then cause some search engines to ignore the head as it doesn’t know what it should be trusting. So you could lose any hard work you’ve done on ensuring you have good description tags etc in an instant.

Additionally if you are a mutli-billion dollar company that most of the world use to search the internet you can probably get away with some errors. If you have a small site that you are trying to get people to come to (and hopefully return to) seems to me like having it valid is just another thing you don’t have to worry about and you can concentrate on other factors.


This topic was automatically closed 91 days after the last reply. New replies are no longer allowed.