JSL (JavaScript Loader)
Do you want an ultra fast web site? Get JSL and optimize your JavaScript loading now!
Imagine there's a 4-lane highway between your web browser and the internet itself. This highway is optimize to let pictures, text, and css fly by. But, when it comes to external scripts, the highway creates a toll booth that slows traffic. The worst part is that pictures text, and css caught behind these scripts have to wait until they pass through. JSL is the latest in toll both avoidance. It creates an express lane that lets all pictures, text, css, and external scripts pass by without worrying about toll booths. That means you save time and money on traffic costs :)
Now for the the techie information...
Features
On-Demand JavaScript Loading new
Browser Cacheable new
Dynamic Asynchronous JavaScript Loading
Lazy Loading
Ordered Loading
Duplicate Source Prevention updated
Ultra Fast and Lightweight
Use DOM or Script Tag writing
Cross-browser
Cross Domain ready new
Works with other JavaScript Libraries
Works with Inline Script Dependencies
Flexible License
http://www.andresvidal.com/jsl
相关文档:
function $id(s) {
return document.getElementById(s);
}
//判断小数
function IsFloat(s) {
if (!/^[+\-]?\d+(.\d+)?$/.test(s))
return false;
else
return ......
<html>19楼空间,`(uqj3~9?!F
<body>
Ob*p#?L;DL0<scrīpt LANGUAGE="Javascrīpt">
+t:{z]tbs0var s = "";19楼空间e kA3HoT1H
s += "网页可见区域宽:" + document.body.clientWidth;19楼空间cy2if}:H/SE@
s += "<br>网页可见区域高:"+ document.bo ......
<html>
<head>
<script type="text/javascript">
function tree(treethis){
if (treethis.alt == "+"){
treethis.alt = "-";
document.getElementById("bench").style. ......
这篇开始会分析流行的js库之写类方式。各种库的写类方式虽然千奇百怪,但仍然逃离不了本质---用构造函数和原型
来组装类。
6、Prototype.js的写类方式
//prototype.js中的代码
var Class = {
create: function() {
return function() {
this.initialize.apply(this, arguments);
}
}
}
//简化 ......
10、mootools.js的写类方式
mootools.js的最新版本是1.2.3,这里使用的是1.2.0。mootool被设计成非常紧凑的,模块化的,面向对象的的js库。mootool中写类用Class类。Class类由Native类new出来的:
/*
*Script: Class.js
*/
var Class = new Native({
name: 'Class',
initialize: function(properties){
propert ......