压缩javascript和css
This document is for establishing build standard for JavaScript and CSS compression
The objective for this document is to establish a companywide JavaScript and CSS compression standard that can be shared crossing multiple SharePoint product development projects. This is the first draft
Overview
Our SharePoint development involves many client side scripts programming style sheet design. In order to improve JavaScript and CSS loading performance and protect our work from copying, we need to establish a standard way to make our script and css shorter and hard to read. Following steps will help you to understand how to do it without knowing all implementation details.
Step 1: Build Compression Environment
System Requirement: Windows XP/Server 2003 Virtual Environment.
Software: JDK 1.4+, yuicompressor-2.4.2.jar
Step 2: JavaScript Naming Standard
1) JavaScript Naming Standard: name-x.y.z.js
2) Compressed JavaScript Naming Standard: name-x.y.x.min.js
Step 3: Compress a JavaScript
Usage: java -jar yuicompressor-2.4.2.jar myfile-x.y.z.js -o myfile-x.y.z.min.js
java -jar yuicompressor-x.y.z.jar [options] [input file]
Global Options
-h, --help Displays this information
--type <js|css> Specifies the type of the input file
--charset <charset> Read the input file using <charset>
--line-break <column> Insert a line break after the specified column number
-v, --verbose Display informational messages and warnings
-o <file> Place the output into <file>. Defaults to stdout.
JavaScript
相关文档:
通过WMI来实现获取客户端计算机硬件及系统信息:
1//系统信息获取
2function getSysInfo(){
3 var locator = new ActiveXObject ("WbemScripting.SWbemLocator");
4 var service = locator.ConnectServer(".");
5 //CPU信息
6 var cpu = new Enumerator (service.ExecQuery("SELECT * from Win32_Processor")).item(); ......
1.把对象的所有引用都设置为null,可以强制性的废除对象(即通知存储单元收集程序销毁对象来释放内存)。这是个好习惯。
2.Array类即数组类,可以如下定义:
var aColors=new Array();
aColors[0]="blue";
aC ......
N.1 基本介绍:
* showModalDialog() (IE 4+ 支持),用来创建一个显示HTML内容的模态对话框。
* showModelessDialog() (IE 5+ 支持) ,用来创建一个显示HTML内容的非模态对话框。
N.2 使用方法:
* vReturnValue = window.showModalDialog(sURL [, vArgument ......
网速很慢,但又得打开 Flash 是一件很痛苦的事情,特别是 Silverlight 来临之际,这个技术可能有点用
具体代码如下
<SCRIPT LANGUAGE="JavaScript">
var starttime = new Date()
</SCRIPT>
<img src="images/ConvLogo.JPG?id=<%Int(37462 * Rnd +&n ......
<a href="<%=Request.ServerVariables("HTTP_REFERER")%>">返回上一步</a>
1. oncontextmenu="window.event.returnValue=false" 将彻底屏蔽鼠标右键
<table border oncontextmenu=return(false)><td>no</table ......