AdWords is now Google Ads. Our new name reflects the full range of advertising options we offer across Search, Display, YouTube, and more. Learn more

Analytics
1.8K members online now
1.8K members online now
Dive into multiple domain (Cross/Sub) tracking, implementing Ecommerce and Enhanced Ecommerce, setting up Event tracking, and Universal Analytics code.
 
Guide Me
star_border
Reply

VS Studio 2015 Validation element 'script' is missing required attribute 'type'.

Visitor ✭ ✭ ✭
# 1
Visitor ✭ ✭ ✭

Hello I'm getting a warning in visual studio 2015 Validation (XHTML 1.0 Transitional): Element 'script' is missing required attribute 'type'. HTML5 Validation. The warning is on the Google analytics script tag for the code Google creates to track your site.

 

I can change the script tag, no issue and I googled all over for this, unable to find the correct answer. Should it be script type="text/javascript" or type="text/jscript" ?? 

 

I don't use java and this was my last place to find out.

Much appreciated.

 

1 Expert replyverified_user
1 ACCEPTED SOLUTION

Accepted Solutions
Marked as Best Answer.
Solution
Accepted by topic author TrackLinq BAS T
August 2016

Re: VS Studio 2015 Validation element 'script' is missing required attribute 'type'.

Top Contributor
# 4
Top Contributor
It is Javascript and contrary to popular belief, the type attribute can be omitted.
If you do not want to rake any risks, enforce attribute type="text/javascript"
VP & Chief Evangelist at Hub'Scan | Contact me
Level 80 Digital Analytics Warrior, KPI Therapist and Keeper of the One True Tagging Plan

View solution in original post

Re: VS Studio 2015 Validation element 'script' is missing required attribute 'type'.

Top Contributor
# 2
Top Contributor
Hi there, quite a few things to tackle:

- JavaScript is not related to Java in any shape, way or form.
- normally, the script type should be text/javascript
- Are you setting up a web application or a standalone app?
VP & Chief Evangelist at Hub'Scan | Contact me
Level 80 Digital Analytics Warrior, KPI Therapist and Keeper of the One True Tagging Plan

Re: VS Studio 2015 Validation element 'script' is missing required attribute 'type'.

Visitor ✭ ✭ ✭
# 3
Visitor ✭ ✭ ✭
It's a web app. HTMlL5 requires a type. And the analytic code it just written as <script> instead of <script type="text/javascript"> You would think they would put a note on their page. I googled the difference earlier but thanks for the confirmation.

So I'm guessing it's javascript?
Thanks

Marked as Best Answer.
Solution
Accepted by topic author TrackLinq BAS T
August 2016

Re: VS Studio 2015 Validation element 'script' is missing required attribute 'type'.

Top Contributor
# 4
Top Contributor
It is Javascript and contrary to popular belief, the type attribute can be omitted.
If you do not want to rake any risks, enforce attribute type="text/javascript"
VP & Chief Evangelist at Hub'Scan | Contact me
Level 80 Digital Analytics Warrior, KPI Therapist and Keeper of the One True Tagging Plan

Re: VS Studio 2015 Validation element 'script' is missing required attribute 'type'.

Visitor ✭ ✭ ✭
# 5
Visitor ✭ ✭ ✭
I changed it to type="text/javascript" I just don't like seeing warnings in my code. and <script> is not HTML5 compliant.
Thanks and you get a star..