Wrox Programmer Forums

Need to download code?

View our list of code downloads.

Go Back   Wrox Programmer Forums > Web Programming > JavaScript > BOOK: Beginning JavaScript 4th Edition
Password Reminder
Register
Register | FAQ | Members List | Calendar | Search | Today's Posts | Mark Forums Read
BOOK: Beginning JavaScript 4th Edition
This is the forum to discuss the Wrox book Beginning JavaScript, 4th Edition by Paul Wilton, Jeremy McPeak; ISBN: 978-0-470-52593-7
Welcome to the p2p.wrox.com Forums.

You are currently viewing the BOOK: Beginning JavaScript 4th Edition section of the Wrox Programmer to Programmer discussions. This is a community of tens of thousands of software programmers and website developers including Wrox book authors and readers. As a guest, you can read any forum posting. By joining today you can post your own programming questions, respond to other developers’ questions, and eliminate the ads that are displayed to guests. Registration is fast, simple and absolutely free .
DRM-free e-books 300x50
Reply
 
Thread Tools Display Modes
  #1 (permalink)  
Old August 27th, 2011, 12:59 AM
Registered User
Points: 8, Level: 1
Points: 8, Level: 1 Points: 8, Level: 1 Points: 8, Level: 1
Activity: 0%
Activity: 0% Activity: 0% Activity: 0%
 
Join Date: Aug 2011
Location: Los Angeles area
Posts: 2
Thanks: 0
Thanked 0 Times in 0 Posts
Default "type" attribute in <script> tag

Is the "type" attribute important enough to basically always include in your opening <script> tag, or can it be optional these days. I've heard a couple different opinions on this - both strict and non-strict views actually. What's the best practice in majority of serious professional work environments?
__________________
William Morris
Reply With Quote
  #2 (permalink)  
Old August 30th, 2011, 08:54 AM
jmcpeak's Avatar
Wrox Author
Points: 361, Level: 6
Points: 361, Level: 6 Points: 361, Level: 6 Points: 361, Level: 6
Activity: 0%
Activity: 0% Activity: 0% Activity: 0%
 
Join Date: Nov 2005
Location: , Texas, USA.
Posts: 77
Thanks: 0
Thanked 12 Times in 12 Posts
Default

Howdy, Latinsteps.

If validation is important to you, and your documents are HTML 4.01 or XHTML, yes, type is required. If your document is HTML5, then no.

The type attribute was important a few years ago because without it, Internet Explorer had to guess what scripting language you used in a particular script element. Since IE7 or IE8, the type attribute defaults to text/javascript. So ultimately no, it's not required (unless validation is important to you).
Reply With Quote
  #3 (permalink)  
Old September 6th, 2011, 01:29 AM
Registered User
Points: 8, Level: 1
Points: 8, Level: 1 Points: 8, Level: 1 Points: 8, Level: 1
Activity: 0%
Activity: 0% Activity: 0% Activity: 0%
 
Join Date: Aug 2011
Location: Los Angeles area
Posts: 2
Thanks: 0
Thanked 0 Times in 0 Posts
Default

Hi Jeremy,

Thank you for a typically clear explanation, and thank you for the very thoughtful sequence of instruction in your book, and the lucid prose that makes it such a terrific book!
__________________
William Morris
Reply With Quote
Reply


Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off
Trackbacks are Off
Pingbacks are On
Refbacks are Off

Similar Threads
Thread Thread Starter Forum Replies Last Post
<%@ MasterType virtualPath="~/EAD_EditGrid.master"%> not recognised MattHoff BOOK: ASP.NET 3.5 Enterprise Application Development with Visual Studio 2008: Problem Design Solutio 1 July 27th, 2010 10:21 AM
"type" attribute missing in $pres() responce senpai BOOK: Professional XMPP Programming with JavaScript and jQuery 11 April 21st, 2010 12:14 PM
<input type="Checkbox" question??? RinoDM HTML Code Clinic 1 October 26th, 2009 06:00 AM
<deployment retail="true"> clarification jsymons BOOK: Beginning ASP.NET 3.5 : in C# and VB BOOK ISBN: 978-0-470-18759-3 1 October 1st, 2009 02:48 PM
<authentication mode="Forms"/> msman88 ASP.NET 3.5 Professionals 10 August 30th, 2009 08:57 AM



All times are GMT -4. The time now is 03:38 AM.


Powered by vBulletin® Version 3.7.0
Copyright ©2000 - 2014, Jelsoft Enterprises Ltd.
© 2013 John Wiley & Sons, Inc.