请选择 进入手机版 | 继续访问电脑版
楼主: Nicolle
2647 11

Professional JavaScript for Web Developers [推广有奖]

巨擘

0%

还不是VIP/贵宾

-

TA的文库  其他...

Python(Must-Read Books)

SAS Programming

Must-Read Books

威望
16
论坛币
12402323 个
通用积分
1620.8615
学术水平
3305 点
热心指数
3329 点
信用等级
3095 点
经验
477211 点
帖子
23879
精华
91
在线时间
9878 小时
注册时间
2005-4-23
最后登录
2022-3-6

Nicolle 学生认证  发表于 2015-10-3 18:02:55 |显示全部楼层 |坛友微信交流群
提示: 作者被禁止或删除 内容自动屏蔽

本帖被以下文库推荐

Jealy 在职认证  发表于 2015-10-3 19:46:38 |显示全部楼层 |坛友微信交流群

学习一下,感谢分享哟!
已有 1 人评分论坛币 收起 理由
Nicolle + 20 鼓励积极发帖讨论

总评分: 论坛币 + 20   查看全部评分

使用道具

ReneeBK 发表于 2015-10-16 09:54:55 |显示全部楼层 |坛友微信交流群
  1. Tag Placement
  2. Traditionally, all <script> elements were placed within the <head> element on a page, such as in this example:

  3. <html>
  4.   <head>
  5.     <title>Example HTML Page</title>
  6.     <script type="text/javascript" src="example1.js"></script>
  7.     <script type="text/javascript" src="example2.js"></script>
  8. </head>
  9.   <body>
  10.     <!-- content here -->
  11.   </body>
  12. </html>
复制代码

使用道具

ReneeBK 发表于 2015-10-16 09:55:37 |显示全部楼层 |坛友微信交流群
  1. Deferred Scripts
  2. HTML 4.01 defines an attribute named defer for the <script> element. The purpose of defer is to indicate that a script won't be changing the structure of the page as it executes. As such, the script can be run safely after the entire page has been parsed. Setting the defer attribute on a <script> element effectively, as shown in the following example, is the same as putting the <script> element at the very bottom of the page (as described in the previous section):

  3. Code View: Scroll / Show All
  4. <html>
  5.   <head>
  6.     <title>Example HTML Page</title>
  7.     <script type="text/javascript" defer="defer" src="example1.js"></script>
  8.     <script type="text/javascript" defer="defer" src="example2.js"></script>
  9.   </head>
  10.   <body>
  11.     <!-- content here -->
  12.   </body>
  13. </html>
复制代码

使用道具

ReneeBK 发表于 2015-10-16 09:56:20 |显示全部楼层 |坛友微信交流群
  1. Changes in XHTML
  2. Extensible HyperText Markup Language, or XHTML, is a reformulation of HTML as an application of XML. The rules for writing code in XHTML are stricter than those for HTML, which affects the <script/> element when using embedded JavaScript code. Although valid in HTML, the following code block is invalid in XHTML:

  3. <script type="text/javascript">
  4.     function compare(a, b) {
  5.         if (a < b) {
  6.             alert("A is less than B");
  7.         } else if (a > b) {
  8.             alert("A is greater than B");
  9.         } else {
  10.             alert("A is equal to B");
  11.         }
  12.     }
  13. </script>
复制代码

使用道具

ReneeBK 发表于 2015-10-16 09:57:17 |显示全部楼层 |坛友微信交流群
  1. Deprecated Syntax
  2. When the <script> element was originally introduced, it marked a departure from traditional HTML parsing. Special rules needed to be applied within this element, and that caused problems for browsers that didn't support JavaScript (the most notable being Mosaic). Nonsupporting browsers would output the contents of the <script> element onto the page, effectively ruining the page's appearance.

  3. Netscape worked with Mosaic to come up with a solution that would hide embedded JavaScript code from browsers that didn't support it. The final solution was to enclose the script code in an HTML comment, like this:

  4. <script><!--
  5.     function sayHi(){
  6.         alert("Hi!");
  7.     }
  8. //--></script>

  9. Using this format, browsers like Mosaic would safely ignore the content inside of the <script> tag, and browsers that supported JavaScript had to look for this pattern to recognize that there was indeed JavaScript content to be parsed.

  10. Although this format is still recognized and interpreted correctly by all web browsers, it is no longer necessary and should not be used.
复制代码

使用道具

ReneeBK 发表于 2015-10-16 09:58:57 |显示全部楼层 |坛友微信交流群
  1. The <noscript> Element

  2. <html>
  3.   <head>
  4.     <title>Example HTML Page</title>
  5.     <script type="text/javascript" defer="defer" src="example1.js"></script>
  6.     <script type="text/javascript" defer="defer" src="example2.js"></script>
  7.   </head>
  8.   <body>
  9.     <noscript>
  10.       <p>This page requires a JavaScript-enabled browser.</p>
  11.     </noscript>
  12.   </body>
  13. </html>
复制代码

使用道具

卯卯人 发表于 2018-2-8 09:02:38 |显示全部楼层 |坛友微信交流群
Book Description
If you want to achieve JavaScript's full potential, it is critical to understand its nature, history, and limitations. To that end, this updated version of the bestseller by veteran author and JavaScript guru Nicholas C. Zakas covers JavaScript from its very beginning to the present-day incarnations including the DOM, Ajax, and HTML5. Zakas shows you how to extend this powerful language to meet specific needs and create dynamic user interfaces for the web that blur the line between desktop and internet. By the end of the book, you'll have a strong understanding of the significant advances in web development as they relate to JavaScript so that you can apply them to your next website.
Book Details
Publisher:        Wrox
By:        Nicholas C. Zakas
ISBN:        978-1-1180-2669-4
Year:        2012
Pages:        960
Language:        English
File size:        53.1 MB
File format:        PDF
eBook
Download:        Professional JavaScript for Web Developers, 3rd Edition

使用道具

卯卯人 发表于 2018-2-22 08:53:19 |显示全部楼层 |坛友微信交流群
没有下载呢?

使用道具

决战风车 发表于 2018-12-8 12:54:00 |显示全部楼层 |坛友微信交流群
好书!有下载链接不

使用道具

您需要登录后才可以回帖 登录 | 我要注册

本版微信群
加JingGuanBbs
拉您进交流群

京ICP备16021002-2号 京B2-20170662号 京公网安备 11010802022788号 论坛法律顾问:王进律师 知识产权保护声明   免责及隐私声明

GMT+8, 2024-4-17 04:52