易截截图软件、单文件、免安装、纯绿色、仅160KB

[翻译]High Performance JavaScript(009)

第三章  DOM Scripting  DOM编程
    DOM scripting is expensive, and it's a common performance bottleneck in rich web applications. This chapter discusses the areas of DOM scripting that can have a negative effect on an application's responsiveness and gives recommendations on how to improve response time. The three categories of problems discussed in the chapter include:
    对DOM操作代价昂贵,在富网页应用中通常是一个性能瓶颈。本章讨论可能对程序响应造成负面影响的DOM编程,并给出提高响应速度的建议。本章讨论三类问题:
• Accessing and modifying DOM elements
访问和修改DOM元素
• Modifying the styles of DOM elements and causing repaints and reflows
修改DOM元素的样式,造成重绘和重新排版
• Handling user interaction through DOM events
通过DOM事件处理用户响应
    But first—what is DOM and why is it slow?
    但首先——什么是DOM?他为什么慢?
DOM in the Browser World  浏览器世界中的DOM
    The Document Object Model (DOM) is a language-independent application interface (API) for working with XML and HTML documents. In the browser, you mostly work with HTML documents, although it's not uncommon for web applications to retrieve XML documents and use the DOM APIs to access data from those documents.
    文档对象模型(DOM)是一个独立于语言的,使用XML和HTML文档操作的应用程序接口(API)。在浏览器中,主要与HTML文档打交道,在网页应用中检索XML文档也很常见。DOM APIs主要用于访问这些文档中的数据。
    Even though the DOM is a language-independent API, in the browser the interface is implemented in JavaScript. Since most of the work in client-side scripting has to do with the underlying document, DOM is an important part of everyday JavaScript coding.
    尽管DOM是与语言无关的API,在浏览器中的接口却是以JavaScript实现的。客户端大多数脚本程序与文档打交道,DOM就成为JavaScript代码日常行为中重要的组成部分。
  


相关文档:

通过javascript获得url参数

页面提交数据一般有两种方法:get,post。post就是所谓的form提交,使用视图;get是通过url提交。
Get方法一般用后台代码(如asp,asp.net)获得参数,代码很简单:Request.QueryString["id"];即可获取。 
有些时候需要直接在前台获取url参数,要用到javascript,js没有直接获取url参数的方法,那么,我们如何通过js ......

javascript的history.go( 1)

javascript的history.go(-1)
echo '<script language="javascript">{alert("留言不能为空!");history.go(-1);}</script>';}
echo '<script language="javascript">{alert("留言不能为空!");return true;}</script>';}
这是不刷新页面的方式 ......

Javascript 面向对象编程(一):封装


学习Javascript,最难的地方是什么?
我觉得,Object(对象)最难。因为Javascript的Object模型很独特,和其他语言都不一样,初学者不容易掌握。
下面就是我的学习笔记,希望对大家学习这个部分有所帮助。我主要参考了Object-Oriented JavaScript和Professional JavaScript for Web Developers (2nd Edition)这两本书。 ......

javascript自动跳转设置

 <script>setTimeout("redirect('<?=$url_forward?>');", <?=$ms?>);</script>
设置分页:$page $pagesize $offset = ($page-1)*$pagesize;
$limit  = "limit $offset,$pagesize" ......
© 2009 ej38.com All Rights Reserved. 关于E健网联系我们 | 站点地图 | 赣ICP备09004571号