Time of Update: 2013-11-22
1、js代碼部分 <script type="text/javascript"> $(function()
Time of Update: 2013-11-22
<html><head><meta http-equiv="content-type" content="text/html"; charset="utf-8"/><script src="./js/jquery-1.8.0.min.js"></script><script
Time of Update: 2013-11-22
//傳回值給父表單function returnParent(value) {//擷取子表單傳回值 var parent = window.dialogArguments; //擷取父頁面 //parent.location.reload(); //重新整理父頁面 if (parent != null && parent != "undefined")
Time of Update: 2013-11-22
其實是先的是最簡單的上傳下載,也是最古老的方法,其實我覺得好的地方是存在一個flash效果, html頁面:引入了 <script type="text/javascript" src="$stylePath/resources/js/swfobject.js"></script><script type="text/javascript"
Time of Update: 2013-11-22
<select id="ddlResourceType" onchange="getvalue(this)"></select> 動態刪除select中的所有options: document.getElementById("ddlResourceType").options.length=0;
Time of Update: 2013-11-22
1.用戶端網頁代碼<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd"><html><head><meta http-equiv="Content-Type" content="text/html;
Time of Update: 2013-11-22
通過網上尋找資料瞭解關於效能最佳化方面的內容,現簡單整理,僅供大家在最佳化的過程中參考使用,如有什麼問題請及時提出,再做出相應的補充修改。 一、 讓代碼簡潔:一些簡略的表達方式也會產生很好的最佳化eg:x=x+1;在不影響功能的情況下可以簡寫為x++; 二、 變數名方法名盡量在不影響語意的情況下簡單。(可以選擇首字母命名)eg:定義數組的長度可以取名為:ArrLen而不需要取為ArrayLength。 三、
Time of Update: 2013-11-22
jQuery是目前非常流行的Javascript庫之一,隨著jQuery應用程式的逐漸增多,其效能最佳化問題是程式員們不可忽視的,我們知道在jQuery中最快的選取器是ID選取器,因為它直接來自於JavaScript的getElementById()方法。 1.總是從ID選取器開始繼承例如有一段HTML代碼: 以下是引用片段:<div id="content"> <form method="post" action=&
Time of Update: 2013-11-22
jGestures簡介 jGestures外掛程式允許你如同原生的jQuery事件一樣監聽以下事件:'pinch'(縮放手勢), 'rotate'(旋轉手勢), 'swipe'(滑動手勢), 'tap'(輕觸) 以及 'orientationchange'(改變裝置方向)。當然,部分事件在PC瀏覽器上可以通過轉換實現。比如 "tapone" 事件可以被
Time of Update: 2013-11-22
js對文字進行編碼涉及3個函數:escape,encodeURI,encodeURIComponent,相應3個解碼函數:unescape,decodeURI,decodeURIComponent 1、傳遞參數時需要使用encodeURIComponent,這樣組合的url才不會被#等特殊字元截斷。
Time of Update: 2013-11-22
JSONArray jsonRoot = new JSONArray(); JSONObject item = new JSONObject(); item.put(UIConstants.JSON_ID, deptId); item.put(UIConstants.JSON_NAME, deptName); item.put(UIConstants.JSON_NODETYPE, "dept");
Time of Update: 2013-11-22
主要代碼: index.htmlXML/HTML Code<script type="text/javascript"> var curPage = 1; //當前頁碼 var total,pageSize,totalPage; //擷取資料 function getData(page){ $.ajax({ type: 'POST', url:
Time of Update: 2013-11-22
使用js的時候,經常會使用字串拼接,但是在IE6和IE7沒有對+function StringBuilder(){ this.init(); }; //初始化StringBuilder類 StringBuilder.prototype.init = function(){ this.array = []; }; //追加資料到StringBuilder類 StringBuilder.prototype.append = function(element){
Time of Update: 2013-11-22
什麼是遍曆?jQuery 遍曆,意為“移動”,用於根據其相對於其他元素的關係來“尋找”(或選取)HTML 元素。以某項選擇開始,並沿著這個選擇移動,直到抵達您期望的元素為止。 展示了一個家族樹。通過 jQuery 遍曆,您能夠從被選(當前的)元素開始,輕鬆地在家族樹中向上移動(祖先),向下移動(子孫),水平移動(同胞)。這種移動被稱為對 DOM 進行遍曆。 圖示解釋: <div> 元素是
Time of Update: 2013-11-22
效果示範: 執行個體代碼:<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd"> <html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en"
Time of Update: 2013-11-22
The jQuery library provides a general-purpose abstraction layer for common web scripting, and is, therefore, useful in almost every scripting situation. Its extensible nature means that we could never cover all possible uses and functions in a
Time of Update: 2013-11-22
Our custom code will go in the second, currently empty, JavaScript file which we included from the HTML using <script src="01.js"></script>. For this example, we only need three lines of code, as
Time of Update: 2013-11-22
如下 兩段代碼 function a(){ var b = 1; window.setTimeout(function(){ //用定時器來觸發就不搞按鈕啦 alert(b); },3000); } a(); function a(){ var b = 1;
Time of Update: 2013-11-17
擷取Javscript執行函數名稱的方法,具體的函數如下: 函數名稱為getFuncName,在為了擷取Javascript函數名稱的時候,直接使用getFuncName函數<script language="javascript">function getFuncName(_callee) {var _text = _callee.toString();var _scriptArr = document.scripts;for (var i=0;
Time of Update: 2013-11-16
前言雖然我CSS水平很水,但是水不是不學好的理由。最近寒冬大哥針對面試發了一點“鬧騷”,我們來看看他的微博是怎麼說的呢?normal flow、containing block、bfc、margin collapse,base line,writing