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

[翻译]High Performance JavaScript(003)

Dynamic Script Elements  动态脚本元素
    The Document Object Model (DOM) allows you to dynamically create almost any part of an HTML document using JavaScript. At its root, the <script> element isn't any different than any other element on a page: references can be retrieved through the DOM, and they can be moved, removed from the document, and even created. A new <script> element can be created very easily using standard DOM methods:
    文档对象模型(DOM)允许你使用JavaScript动态创建HTML的几乎全部文档内容。其根本在于,<script>元素与页面其他元素没有什么不同:引用变量可以通过DOM进行检索,可以从文档中移动、删除,也可以被创建。一个新的<script>元素可以非常容易地通过标准DOM函数创建:
var script = document.createElement_x("script");
script.type = "text/javascript";
script.src = "file1.js";
document.getElementsByTagName("head")[0].appendChild(script);
    This new <script> element loads the source file file1.js. The file begins downloading as soon as the element is added to the page. The important thing about this technique is that the file is downloaded and executed without blocking other page processes, regardless of where the download is initiated. You can even place this code in the <head> of a document without affecting the rest of the page (aside from the one HTTP connection that is used to download the file).
    新的<script>元素加载file1.js源文件。此文件当元素添加到页面之后立刻开始下载。此技术的重点在于:无论在何处启动下载,文件的下载和运行都不会阻塞其他页面处理过程。你甚至可以将这些代码放在<head>部分而不会对其余部分的页面代码造成影响(除了用于下载文件的HTTP连接)。
    When a file is downloaded using a dynamic script node, the retrieved code is typically executed immediately (except in Firefox and Opera, which will wait until any previous dynamic script nodes have executed). This works well when the script is self-executing but


相关文档:

HTML+Javascript+XML


上面所说有关HTML的内容非常少又简单,但对已经了解的人来说就是没用的.
如有问题可到权威网 http://www.html.com/ 上查看
以下开始说说关于XML的一些知识.
XML也是标记语言,可它是自定义的,没有已给定格式.不具体说它,给出例子就可明了.

<NAME>TOM</NAME>
<SEX>M</SEX>
以上内容的< ......

Javascript 的词法作用域、调用对象和闭包

作用域 Scope
Javascript 中的函数属于词法作用域,也就是说函数在它被定义时的作用域中运行而不是在被执行时的作用域内运行。这是犀牛书上的说法。但“定义时”和“执行(被调用)时”这两个东西有些人搞不清楚。简单来说,一个函数A在“定义时”就是 function A(){} 这个语句执行的时候就 ......

javascript写类方式之一

从这篇起,会由浅到深的分析js OO之写类方式,大概会有5-8篇。后面陆续会分析流行库(框架)的写类方式。为了讨论的单一性,暂不考虑类的继承,(私有,受保护)属性或方法。
EMCA262规范中没有类(class)的概念,js的new只是让他看起来更像c++,java一点。这里说的写类,只是书写js代码风格而已。
1、构造函数方式
/**
* P ......

JavaScript 动态数组 实例


<html>
<body>
<script type="text/javascript">
//方法一
var num_arr= [];
for (var i = 0 ; i < 10 ;  i ++)
{
  num_arr[i] = i; 
}
document.write(num_arr+'</br>');
//方法二
var obj_arr=new Array();
obj_arr[6]='ss';
document.write(obj_arr.len ......

[翻译]High Performance JavaScript(002)

Grouping Scripts 成组脚本
    Since each <script> tag blocks the page from rendering during initial download, it's helpful to limit the total number of <script> tags contained in the page. This applies to both inline scripts as well as those in external files. Every time ......
© 2009 ej38.com All Rights Reserved. 关于E健网联系我们 | 站点地图 | 赣ICP备09004571号