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

[翻译]High Performance JavaScript(029)

Working Around Caching Issues  关于缓存问题
    Adequate cache control can really enhance the user experience, but it has a downside: when revving up your application, you want to make sure your users get the latest version of the static content. This is accomplished by renaming static resources whenever they change.
    充分利用缓存控制可真正提高用户体验,但它有一个缺点:当应用程序更新之后,你希望确保用户得到静态内容的最新版本。这通过对改动的静态资源进行重命名实现。
    Most often, developers add a version or a build number to filenames. Others like to append a checksum. Personally, I like to use a timestamp. This task can be automated using Ant. The following target takes care of renaming JavaScript files by appending a timestamp in the form of yyyyMMddhhmm:
    大多情况下,开发者向文件名中添加一个版本号或开发编号。有人喜欢追加一个校验和。个人而言,我更喜欢时间戳。此任务可用Ant自动完成。下面的目标体通过附加一个yyyyMMddhhmm格式的时间戳重名名JavaScript文件:
<target name="js.copy">
  <!-- Create the time stamp -->
  <tstamp/>
  <!-- Rename JavaScript files by appending a time stamp -->
  <copy todir="${build.dir}">
    <fileset dir="${src.dir}" includes="*.js"/>
    <globmapper from="*.js" to="*-${DSTAMP}${TSTAMP}.js"/>
  </copy>
</target>
Using a Content Delivery Network  使用内容传递网
    A content delivery network (CDN) is a network of computers distributed geographically across the Internet that is responsible for delivering content to end users. The primary reasons for using a CDN are reliability, scalability, and above all, performance. In fact, by serving content from the location closest to the user, CDNs are able to dramatically decrease network latency.
    内容传递网络(CDN)是按照地理分布的计算机网络,通过以太网负责向最终用户分


相关文档:

Javascript检查日期格式是否合法的一种简化方法。

常规的方法是将年月日取出,然后分别判断范围,然后就判断闰年2月的天数
可以通过new Date(string)的构造,比较年月日字符是否发生变化判断。
function CheckDate(text) {
if (!text) return false;
text = text.replace(/[\/-]0?/g, "/");
if (!text.match(/^\d{4}\/\d{1,2}\/\d{1,2}$/)) return true; ......

javascript动态装入XML数据


使用javascript创建Microsoft XML DOM,就可以完成这一工作.
// 装入数据.
var source = new ActiveXObject("Microsoft.XMLDOM");
source.async = false
source.load("history.xml");
// 装入样式表.
var stylesheet = new ActiveXObject("Microsoft.XMLDOM");
stylesheet.async = false
stylesheet.load( ......

[翻译]High Performance JavaScript(019)

第六章  Responsive Interfaces  响应接口
    There's nothing more frustrating than clicking something on a web page and having nothing happen. This problem goes back to the origin of transactional web applications and resulted in the now-ubiquitous "please click only once" m ......

[翻译]High Performance JavaScript(020)

Yielding with Timers  用定时器让出时间片
    Despite your best efforts, there will be times when a JavaScript task cannot be completed in 100 milliseconds or less because of its complexity. In these cases, it's ideal to yield control of the UI thread so that UI updates may occur ......

[翻译]High Performance JavaScript(025)

第八章  Programming Practices  编程实践
    Every programming language has pain points and inefficient patterns that develop over time. The appearance of these traits occurs as people migrate to the language and start pushing its boundaries. Since 2005, when the term "Ajax" ......
© 2009 ej38.com All Rights Reserved. 关于E健网联系我们 | 站点地图 | 赣ICP备09004571号