JavaScript: The Definitive Guide, 6th Edition Chapter 1 Note 1

本文介绍JavaScript客户端技术的使用,包括确认对话框、超时时间设置、DOM元素操作、用户输入获取、HTML内容设置、浏览器数据存储、HTTP请求发送及canvas元素绘图等关键功能,并提醒开发者注意避免在代码中插入多余的换行符导致语法错误。

1.2 Client-Side JavaScript:

 

confirm()函数:用于弹出确认对话框,setTimeout()函数用于,设置超时时间。

	<script type="text/javascript">
			function moveon()
			{
				var answer = confirm("Ready to move On?");
				if(answer)
				{
				  window.location = "Http://Google.com";
			  }
			};
			
			setTimeout(moveon,6000);
		</script>

  confirm 拼写错误将导致程序不能正常运行。

2.The Example demonstartes a number of core JavaScript language features, and also demonstares important client-side JavaScript techniques:

     1.How to find elements in a document.

     2.How to get user input from form input elements

     3.How to set the HTML content of document elements.

     4.How to store data in browser.

     5.How to make scripted HTTP requests.

     6.How to draw graphics with the <canvas> element.

If a line break appears after any of these words(before any other tokens),JavaScript will always interpret 

that line break as a semicolon.For example,if you write:

Return 

true;

  JavaScript assumes you meant:

return; true;

  However,you probably meant:

return true;

  What this means is that you must not insert a line break between retrun,break,or continue and the expression that follows the keyword.If you do insert a line break,your code is likely to failin a nonobvious way that is difficult to debug.

转载于:https://www.cnblogs.com/kfx2007/archive/2012/08/16/2642729.html

中文名: JavaScript权威指南 (第6版) 原名: JavaScript: The Definitive Guide: Activate Your Web Pages, 6th edition 作者: David Flanagan 版本: 英文文字版-pdf/EPUB + 完整书中源代码 出版社: O'Reilly 书号: 978-0596805524 发行时间: 2011年05月10日 语言: 英文 内容简介: Since 1996, JavaScript: The Definitive Guide has been the bible for JavaScript programmers—a programmer's guide and comprehensive reference to the core language and to the client-side JavaScript APIs defined by web browsers. The 6th edition covers HTML5 and ECMAScript 5, with new chapters on jQuery and server side JavaScript. It's recommended for experienced programmers who want to learn the programming language of the Web, and for current JavaScript programmers who want to master it. 目录: Chapter 1 Introduction to JavaScript Core JavaScript Chapter 2 Lexical Structure Chapter 3 Types, Values, and Variables Chapter 4 Expressions and Operators Chapter 5 Statements Chapter 6 Objects Chapter 7 Arrays Chapter 8 Functions Chapter 9 Classes and Modules Chapter 10 Pattern Matching with Regular Expressions Chapter 11 JavaScript Subsets and Extensions Chapter 12 Server-Side JavaScript Client-Side JavaScript Chapter 13 JavaScript in Web Browsers Chapter 14 The Window Object Chapter 15 Scripting Documents Chapter 16 Scripting CSS Chapter 17 Handling Events Chapter 18 Scripted HTTP Chapter 19 The jQuery Library Chapter 20 Client-Side Storage Chapter 21 Scripted Media and Graphics Chapter 22 HTML5 APIs Core JavaScript Reference Client-Side JavaScript Reference Colophon
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值