|
 |
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 .
|
 |
|
|
 |

August 27th, 2011, 12:59 AM
|
Registered User
|
|
Join Date: Aug 2011
Location: Los Angeles area
Posts: 2
Thanks: 0
Thanked 0 Times in 0 Posts
|
|
"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?
|

August 30th, 2011, 08:54 AM
|
 |
Wrox Author
|
|
Join Date: Nov 2005
Location: , Texas, USA.
Posts: 87
Thanks: 0
Thanked 18 Times in 17 Posts
|
|
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).
|

September 6th, 2011, 01:29 AM
|
Registered User
|
|
Join Date: Aug 2011
Location: Los Angeles area
Posts: 2
Thanks: 0
Thanked 0 Times in 0 Posts
|
|
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!
|
Thread Tools |
|
Display Modes |
Linear Mode
|
Posting Rules
|
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts
HTML code is Off
|
|
|
|
 |