Ò׽ؽØͼÈí¼þ¡¢µ¥Îļþ¡¢Ãâ°²×°¡¢´¿ÂÌÉ«¡¢½ö160KB

ѹËõ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


Ïà¹ØÎĵµ£º

javascriptЧÂʾ­Ñé̸(Ò»)

±¾ÎÄÖ÷ÒªÊdzöÓÚÓÐÅóÓÑʹÓÃÎÒÔ­À´Ð´µÄautocompleteµÄJS¿Ø¼þ¡£µ±Êý¾ÝÁ¿´óµÄʱºò£¬»á³öÏÖЧÂʼ«ÆäÂýµÄÇé¿ö£¬ÎÒÔÚÕâ¶Îʱ¼ä×ö³öµÄһЩ²âÊÔÒ²¼°Ò»Ð©¾­Ñ飬Óë´ó¼Ò·ÖÏí£¬Èç¹ûÓдíµÄµØ·½£¬»¹ÇëÖ¸³ö¡£
¾­¹ý²âÊÔ£¬ÎÒÃǻᷢÏÖÈçϵÄÇé¿ö»òÕß˵µÄ½áÂÛ£¬Èç¹ûÄúµÄ²âÊÔ½á¹ûÓëÎҵIJ»·û£¬Çë˵Ã÷Ô­Òò£¬ÒÔ±ãÏ໥ѧϰ¡£
1£©µ±Ò»¸ö½Ï´óµÄHTML×Ö· ......

ͨ¹ýjavascript»ñµÃurl²ÎÊý

Ò³ÃæÌá½»Êý¾ÝÒ»°ãÓÐÁ½ÖÖ·½·¨£ºget,post¡£post¾ÍÊÇËùνµÄformÌá½»£¬Ê¹ÓÃÊÓͼ£»getÊÇͨ¹ýurlÌá½»¡£
Get·½·¨Ò»°ãÓúǫ́´úÂ루Èçasp,asp.net£©»ñµÃ²ÎÊý£¬´úÂëºÜ¼òµ¥£ºRequest.QueryString["id"];¼´¿É»ñÈ¡¡£ 
ÓÐЩʱºòÐèÒªÖ±½ÓÔÚǰ̨»ñÈ¡url²ÎÊý£¬ÒªÓõ½javascript£¬jsûÓÐÖ±½Ó»ñÈ¡url²ÎÊýµÄ·½·¨£¬ÄÇô£¬ÎÒÃÇÈçºÎͨ¹ýjs ......

WPFÖÐWebBrowser×¢Èëjavascript½Å±¾

WPFµÄWebBrowserºÍWinFormµÄWebBrowserÓÐÒ»¶¨Çø±ð¡£
ÒªÏòÆäÖÐ×¢Èëjavascript½Å±¾£¬¾­¹ý±¾ÈËÊÔÑ飬ÏÂÃæÒ»Ìõ·¿ÉÒÔ×ßͨ£º
 mshtml.HTMLDocument htmlDoc = Browser.Document as mshtml.HTMLDocument;
var head = htmlDoc.getElementsByTagName("head").Cast<HTMLHeadElement>().First();
var script = (IHTMLS ......

JavaScriptѧϰ±Ê¼Ç£¨ËÄ£©

1.³öÓÚ°²È«¿¼ÂÇ£¬JavaScriptÖÐÖ»Óпª·¢Õß×Ô¶¨ÒåµÄÀà¿ÉÒÔ±»¼Ì³Ð¡£
2.ʹÓöÔÏóð³äʵÏּ̳Ð
      function ClassA(sColor){
         this.color=sColor;
         this.showColor=function (){
 &nbs ......

JavaScriptÌâÐÍ

 1£®ÈçºÎ»ñÈ¡±íµ¥<select>ÓòµÄÑ¡Ôñ²¿·ÖµÄÎı¾£¿
<form name="a">
<select name="a" size="1" onchange="_sel(this)">
<option value="a">1</option>
<option value="b">2</option>
<option value="c">3</option>
< ......
© 2009 ej38.com All Rights Reserved. ¹ØÓÚE½¡ÍøÁªÏµÎÒÃÇ | Õ¾µãµØͼ | ¸ÓICP±¸09004571ºÅ