SlideShare une entreprise Scribd logo
1  sur  21
Ajax 应用开发最佳实践 Alex Cheng http://www.cheng-fu.com http://cn.linkedin.com/in/chengfu
Web 2.0 应用开发 ,[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object]
Ajax 应用组成元素 ,[object Object],[object Object],[object Object],[object Object],[object Object],[object Object]
使用富含语义的 HTML ,[object Object],[object Object]
HTML 中表示文档结构和富含语义的元素 元素 说明 <h1> 、 <h2> 、 <h3> 、 <h4> 、 <h5> 和 <h6> 表示不同级别的标题。 <p> 表示文档中的一个段落。 <em> 、 <strong> 表示对文档中文本的强调。 <abbr> 、 <acronym> 表示缩写词。 <blockquote> 、 <q> 表示文档中的引用。 <ul> 、 <ol> 、 <li> 表示列表型的内容和其中的条目。 <dl> 、 <dt> 、 <dd> 表示术语及其描述。 <cite> 表示对外部资料的引用。 <code> 表示程序源代码。
富含语义的 HTML 最佳实践 ,[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object]
使用微格式( Microformat ) ,[object Object],[object Object],[object Object]
CSS ,[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object]
解决浏览器兼容性问题 ,[object Object],[object Object],[object Object],[object Object],[object Object],[object Object]
可维护的 CSS ,[object Object],[object Object],[object Object],[object Object],[object Object],[object Object]
DOM 操作 ,[object Object],[object Object],[object Object],[object Object]
使用 DOM 的方式 ,[object Object],[object Object],[object Object],[object Object],[object Object],[object Object]
选择最适合的技术 ,[object Object],[object Object],[object Object],[object Object],[object Object],[object Object]
提高 DOM 操作性能 ,[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object]
事件处理 ,[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object]
事件传播过程
避免内存泄露 ,[object Object],[object Object],[object Object],[object Object],[object Object]
提高事件处理性能 ,[object Object],[object Object],[object Object],[object Object]
安全 ,[object Object],[object Object],Bank.com  http://www.bank.com/transfer?to=xxx&amount=10000 BankHacker.com <img src=‘http://www.bank.com/transfer?to=hacker&amout=10’ > Bank.com Login Cookie saved Use BankHacker.com Use saved cookie
安全 ,[object Object],http://www.bank.com/history [{“time” : “”, “name” : “”}, {}, {}] <script src=‘http://www.bank.com/history’></script> Array 的构造方法是可以被重定义的。 <script type='text/javascript'> function Array() { var obj = this; var ind = 0; var getNext = function(x) { obj[ind++] setter = getNext; if (x) alert(“Data stolen from array: &quot; + x.toString()); }; this[ind++] setter = getNext; } </script> <script type='text/javascript' src='http://bank.com/history'> </script>
性能 ,[object Object],[object Object]

Contenu connexe

Similaire à Ajax应用开发最佳实践

React js入門
React js入門React js入門
React js入門昶宇 賴
 
Re Introduce Web Development
Re Introduce Web DevelopmentRe Introduce Web Development
Re Introduce Web Developmentfinian lau
 
Android应用开发 - 沈大海
Android应用开发 - 沈大海Android应用开发 - 沈大海
Android应用开发 - 沈大海Shaoning Pan
 
常用Js框架比较
常用Js框架比较常用Js框架比较
常用Js框架比较Adam Lu
 
Learning JavaScript in Three Web Apps(中文)
Learning JavaScript in Three Web Apps(中文)Learning JavaScript in Three Web Apps(中文)
Learning JavaScript in Three Web Apps(中文)Dexter Yang
 
Visual studio 2012 與 asp.net 4.5 (新功能與開發介紹) 第一天
Visual studio 2012 與 asp.net 4.5 (新功能與開發介紹) 第一天Visual studio 2012 與 asp.net 4.5 (新功能與開發介紹) 第一天
Visual studio 2012 與 asp.net 4.5 (新功能與開發介紹) 第一天Gelis Wu
 
[2008]网站重构 -who am i
[2008]网站重构 -who am i[2008]网站重构 -who am i
[2008]网站重构 -who am iTwinsen Liang
 
富文本编辑器在互联网上的应用
富文本编辑器在互联网上的应用富文本编辑器在互联网上的应用
富文本编辑器在互联网上的应用luolonghao
 
培训第一周
培训第一周培训第一周
培训第一周SDtoo
 
01 Flex Introduction
01 Flex Introduction01 Flex Introduction
01 Flex Introductionguestd960b1
 
01 Flex Introduction
01 Flex Introduction01 Flex Introduction
01 Flex IntroductionScissor Lee
 
Django敏捷开发 刘天斯
Django敏捷开发 刘天斯Django敏捷开发 刘天斯
Django敏捷开发 刘天斯liuts
 
ASP.Net MVC2 简介
ASP.Net MVC2 简介ASP.Net MVC2 简介
ASP.Net MVC2 简介Allen Lsy
 
Real World ASP.NET MVC
Real World ASP.NET MVCReal World ASP.NET MVC
Real World ASP.NET MVCjeffz
 

Similaire à Ajax应用开发最佳实践 (20)

React js入門
React js入門React js入門
React js入門
 
J S教材
J S教材J S教材
J S教材
 
Re Introduce Web Development
Re Introduce Web DevelopmentRe Introduce Web Development
Re Introduce Web Development
 
敦群學院-SharePoint精英計畫-系統開發-Day 3
敦群學院-SharePoint精英計畫-系統開發-Day 3敦群學院-SharePoint精英計畫-系統開發-Day 3
敦群學院-SharePoint精英計畫-系統開發-Day 3
 
四天学会Ajax
四天学会Ajax四天学会Ajax
四天学会Ajax
 
Android应用开发 - 沈大海
Android应用开发 - 沈大海Android应用开发 - 沈大海
Android应用开发 - 沈大海
 
常用Js框架比较
常用Js框架比较常用Js框架比较
常用Js框架比较
 
Learning JavaScript in Three Web Apps(中文)
Learning JavaScript in Three Web Apps(中文)Learning JavaScript in Three Web Apps(中文)
Learning JavaScript in Three Web Apps(中文)
 
Visual studio 2012 與 asp.net 4.5 (新功能與開發介紹) 第一天
Visual studio 2012 與 asp.net 4.5 (新功能與開發介紹) 第一天Visual studio 2012 與 asp.net 4.5 (新功能與開發介紹) 第一天
Visual studio 2012 與 asp.net 4.5 (新功能與開發介紹) 第一天
 
[2008]网站重构 -who am i
[2008]网站重构 -who am i[2008]网站重构 -who am i
[2008]网站重构 -who am i
 
Wap2.0
Wap2.0Wap2.0
Wap2.0
 
Wap2.0
Wap2.0Wap2.0
Wap2.0
 
富文本编辑器在互联网上的应用
富文本编辑器在互联网上的应用富文本编辑器在互联网上的应用
富文本编辑器在互联网上的应用
 
培训第一周
培训第一周培训第一周
培训第一周
 
01 Flex Introduction
01 Flex Introduction01 Flex Introduction
01 Flex Introduction
 
01 Flex Introduction
01 Flex Introduction01 Flex Introduction
01 Flex Introduction
 
漫谈web前端
漫谈web前端漫谈web前端
漫谈web前端
 
Django敏捷开发 刘天斯
Django敏捷开发 刘天斯Django敏捷开发 刘天斯
Django敏捷开发 刘天斯
 
ASP.Net MVC2 简介
ASP.Net MVC2 简介ASP.Net MVC2 简介
ASP.Net MVC2 简介
 
Real World ASP.NET MVC
Real World ASP.NET MVCReal World ASP.NET MVC
Real World ASP.NET MVC
 

Plus de Fu Cheng

Introduction to Web Components
Introduction to Web ComponentsIntroduction to Web Components
Introduction to Web ComponentsFu Cheng
 
The Evolution of Java
The Evolution of JavaThe Evolution of Java
The Evolution of JavaFu Cheng
 
Java SE 7 New Features and Enhancements
Java SE 7 New Features and EnhancementsJava SE 7 New Features and Enhancements
Java SE 7 New Features and EnhancementsFu Cheng
 
Advanced guide to develop ajax applications using dojo
Advanced guide to develop ajax applications using dojoAdvanced guide to develop ajax applications using dojo
Advanced guide to develop ajax applications using dojoFu Cheng
 
Java类加载器
Java类加载器Java类加载器
Java类加载器Fu Cheng
 
Advanced JavaScript
Advanced JavaScriptAdvanced JavaScript
Advanced JavaScriptFu Cheng
 

Plus de Fu Cheng (6)

Introduction to Web Components
Introduction to Web ComponentsIntroduction to Web Components
Introduction to Web Components
 
The Evolution of Java
The Evolution of JavaThe Evolution of Java
The Evolution of Java
 
Java SE 7 New Features and Enhancements
Java SE 7 New Features and EnhancementsJava SE 7 New Features and Enhancements
Java SE 7 New Features and Enhancements
 
Advanced guide to develop ajax applications using dojo
Advanced guide to develop ajax applications using dojoAdvanced guide to develop ajax applications using dojo
Advanced guide to develop ajax applications using dojo
 
Java类加载器
Java类加载器Java类加载器
Java类加载器
 
Advanced JavaScript
Advanced JavaScriptAdvanced JavaScript
Advanced JavaScript
 

Ajax应用开发最佳实践

  • 1. Ajax 应用开发最佳实践 Alex Cheng http://www.cheng-fu.com http://cn.linkedin.com/in/chengfu
  • 2.
  • 3.
  • 4.
  • 5. HTML 中表示文档结构和富含语义的元素 元素 说明 <h1> 、 <h2> 、 <h3> 、 <h4> 、 <h5> 和 <h6> 表示不同级别的标题。 <p> 表示文档中的一个段落。 <em> 、 <strong> 表示对文档中文本的强调。 <abbr> 、 <acronym> 表示缩写词。 <blockquote> 、 <q> 表示文档中的引用。 <ul> 、 <ol> 、 <li> 表示列表型的内容和其中的条目。 <dl> 、 <dt> 、 <dd> 表示术语及其描述。 <cite> 表示对外部资料的引用。 <code> 表示程序源代码。
  • 6.
  • 7.
  • 8.
  • 9.
  • 10.
  • 11.
  • 12.
  • 13.
  • 14.
  • 15.
  • 17.
  • 18.
  • 19.
  • 20.
  • 21.