HTML5高级程序设计 第一章

应用程序编程接口

1.HTML5语法

1.字符编码

用于指定一个HTML5文档使用的是那种字符集,以便告诉浏览器应该使用哪种编码对文本进行存储或者通过网络进行传递。在HTML5中使用<meta>元素指定字符编码。

2.DOCTYPE文档类型

用于告诉浏览器应该使用什么样的文档类型来解析HTML文档。

3.SVG

称为可缩放矢量图形,用于表示二维矢量图形的一种格式。

4.应用程序编程接口

提供应用程序与开发人员基于某软件或硬件得以访问一组功能的能力,而访问又无需源码,或理解内部工作机制的细节。

5.兼容性

并不是所有浏览器都支持HTML5的新特性。解决方法:1.通过程序对User-Agent判断不同的浏览器显示不同的页面。2.使用JavaScript使不支持HTML5的浏览器支持HTML5标签。

2.元素选择方法

1.querySelector()方法

返回指定选择器或选择器组匹配的第一个HTML元素Element()。如找不到匹配项,则返回NULL。语法如下:

element=document.querySelector(selectors);

2.querySelectorAll()方法

返回指定的选择器组匹配的文档中的元素列表,返回的对象是NodeList, 语法如下:

elementList=document.quertSelectorAll(selectors);

3.事件绑定

addEventListener多次绑定

addEventListener添加事件接听器

removeEventListener删除事件接听器

setAttribute添加属性

4.Console对象

常见用途

1.调试程序,显示网页代码运行时的错误信息。

2.提供了一个命令行接口,用来与网页代码互动。

 console.log 输出信息

 console.error  错误

 console.warn   警告

 console.assert  断言

  • 0
    点赞
  • 0
    收藏
    觉得还不错? 一键收藏
  • 0
    评论
Book Description HTML5 is here, and with it, rich Internet applications (RIAs) take on a power, ease, scalability, and responsiveness that neither Ajax nor Comet could ever achieve. With this book, developers will learn how to use the latest cutting-edge web technology—available in the most recent versions of modern browsers—to build real-time web applications with unparalleled functionality, speed, and responsiveness. The HTML5 specification represents the next evolution—or rather, a revolution—of web communications required to build real-time applications. WebSockets and server-sent events provide not only a standard against which real-time web applications can be built, but also a socket, native to the browser, that facilitates network programming from the browser with efficient bidirectional (full-duplex) communication over a single connection. * Explains how you can create real-time HTML5 applications that tap the full potential of modern browsers * Provides practical, real-world examples of HTML5 features in action * Shows which HTML5 features are supported in current browsers and platforms What you’ll learn * How the HTML5 specification has evolved * How to design, develop, and run cutting-edge real-time web applications using new HTML5 features like WebSockets, server-sent events, cross-document messaging, geo location, storage, canvas, and video * Which features are available in browsers today and how you can run your applications in older browsers that do not support HTML5 features * How to use client-side APIs to communicate directly with back-end systems such as messaging systems, JMS brokers, XMPP servers, and online services such as Google Wave Who is this book for? This book is for developers who want to use the latest cutting-edge technology available in current browsers; developers who want to create dynamic, data-driven web applications; and developers who want to know which HTML5 features are supported in current browsers. About the Author Peter Lubbers is the Director of Documentation and Training at Kaazing Corporation, where he oversees all aspects of documentation and training. Peter also teaches a three-day HTML5 training course for Skills Matter. Prior to joining Kaazing, Peter worked as an information architect at Oracle, where he wrote many books, including the award-winning Oracle Application Server Portal Configuration Guide. At Oracle, Peter also developed documentation automation solutions and two of his inventions are patented. A native of the Netherlands, Peter served as a Special Forces commando in the Royal Dutch Green Berets. Peter lives on the edge of the Tahoe National Forest and in his spare time, he loves to run in the Sierra Nevada foothills and around Lake Tahoe (preferably in one go!). Brian Albers is the VP of development at Kaazing. Brian has over 13 years of experience in the field of User Interface technologies. Prior to joining Kaazing, Brian worked as Senior Development Manager at Oracle, where he led the planning and designing of the next generation of Oracle's UI technology—an effort publicly known as ADF Faces. During his 10 year tenure at Oracle, Brian worked primarily on mixing cutting-edge technology with large enterprise demands (internationalization, accessibility, scalability). He proposed the open source donation of ADF Faces, which ultimately became the Apache MyFaces Trinidad project. Brian also led a cross-team effort to develop a DHTML rich client and a mobile client presentation layer for Oracle's Project Fusion. Brian received a BS degree in Computer Science from the University of Texas, Austin, and a BA degree in Plan II Honors from the University of Texas, Austin. Frank Salim is a polyglot programmer with a keen interest in making life easier for his fellow coders. Frank leads WebSocket development at Kaazing. He is an open source advocate and a committer in several open source projects. Ric Smith is director of Oracle’s Fusion Middleware E20 Architect Team. Formerly, he led business and product strategy at Kaazing. Ric has also held various roles in product management, consulting, and software engineering. In addition, Ric is a frequent speaker at international events and has written articles featured in leading industry publications such as Java Developer's Journal and AJAX World Magazine.

“相关推荐”对你有帮助么?

  • 非常没帮助
  • 没帮助
  • 一般
  • 有帮助
  • 非常有帮助
提交
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

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

抵扣说明:

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

余额充值