Time of Update: 2018-12-08
於是這code便誕生了,如下: 複製代碼 代碼如下:<html xmlns="http://www.w3.org/1999/xhtml" > <head runat="server"> <title>無標題頁</title> <script type="text/javascript" language="javascript"> var currentIndex=-1;//儲存提示框中選擇的索引 var sumSearchCount=
Time of Update: 2018-12-08
對於擷取某一個元素的值,如input框,我們往往是用$('#test').val(); $('#test')這個我就不多說了,反正就是擷取ID為test的這個元素。 $('#test').val(),也就是擷取它的值,一般來說,凡是能夠用在FORM裡的元素,都可以用.val()來進行值的擷取,如input,textarea,select等,都可以用.val()來擷取它們的當前值
Time of Update: 2018-12-08
今天重點一個toggle(fn,fn,….)函數,主要是用來切換某個事件的輪換操作。 比如:對一個按鈕的點擊事件和一個DIV的背景,點擊一次按鈕,將DIV的背景顯示為藍色,點擊第二次的時候要將DIV的 背景色改為黑色。 我們定義的HTML代碼如下: <body> <input type="button" id="btnShow" value="Toggle"/> <div id="DivToggle">此處顯示 id "DivToggle"
Time of Update: 2018-12-08
//得到自身URL後的參數:使用者名稱 loadVariables("", u); uname.text=u; htm: var fla=''; fla+='<object classid="clsid:d27cdb6e-ae6d-11cf-96b8-444553540000" codebase="http://fpdownload.macromedia.com/pub/shockwave/cabs/flash/swflash.cab#version=8,0,0,0" width="250
Time of Update: 2018-12-08
複製代碼 代碼如下:<script> /************************************************* *************************************************/ Validator = { Require : /.+/, Email : /^\w+([-+.]\w+)*@\w+([-.]\w+)*\.\w+([-.]\w+)*$/, Phone : /^((\(\d{2,3}\))|(\d{3}\-))?
Time of Update: 2018-12-08
Step 1: Configurate Dojo 從http://www.dojotoolkit.org/downloads 下載最新的Dojo包,並且放到你工程的某一個地方。比如,我就放把我的dojo庫放在lib檔案夾下(一)。 圖一(檔案目錄結構) 在你的頁面中加入如下代碼,那麼就完成了最基本的配置。 <script type="text/javascript" src="lib/dojo/dojo/dojo.js" djConfig ="parseOnLoad:true,
Time of Update: 2018-12-08
這裡是js的代碼: 複製代碼 代碼如下:jQuery.fn.size = function() { return jQuery(this).get(0).options.length; } //獲得選中項的索引 jQuery.fn.getSelectedIndex = function() { return jQuery(this).get(0).selectedIndex; } //獲得當前選中項的文本 jQuery.fn.getSelectedText = function() {
Time of Update: 2018-12-08
複製代碼 代碼如下:option explicit dim fpath,fso,logfile,fwrite fpath=inputbox ("輸入目標檔案夾","檔案處理器") logfile="logfile.txt" set fso=createobject("scripting.filesystemobject") Set fwrite=fso.opentextfile(logfile,8,true) getfilename fpath fwrite.close Set
Time of Update: 2018-12-08
自己寫了一個很簡單的jquery外掛程式,在頁面中調用其中的函數就可實現. 外掛程式原始碼(listtolist.js): 複製代碼 代碼如下:/** fromid:源list的id. toid:目標list的id. moveOrAppend參數("move"或者是"append"): move -- 源list中選中的option會刪除.源list中選中的option移動到目標list中,若目標list中已存在則該option不添加. append --
Time of Update: 2018-12-08
驗證數位Regex集 驗證數字:^[0-9]*$ 驗證n位的數字:^\d{n}$ 驗證至少n位元字:^\d{n,}$ 驗證m-n位的數字:^\d{m,n}$ 驗證零和非零開頭的數字:^(0|[1-9][0-9]*)$ 驗證有兩位小數的正實數:^[0-9]+(.[0-9]{2})?$ 驗證有1-3位小數的正實數:^[0-9]+(.[0-9]{1,3})?$ 驗證非零的正整數:^\+?[1-9][0-9]*$ 驗證非零的負整數:^\-[1-9][0-9]*$ 驗證非負整數(正整數 + 0) ^\d+
Time of Update: 2018-12-08
複製代碼 代碼如下:<!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"> <head> <title>Untitled Page</title>
Time of Update: 2018-12-08
複製代碼 代碼如下:// JavaScript Document function sub1() { // 用Form名稱直接引用form對象 //form1.method = "get"; // 將form名稱作為document對象的屬性來引用form對象, // 並用user作為form對象的屬性來引用名為user的文字框元素對象 // document.form1.user.value = "lisi"; var
Time of Update: 2018-12-08
xmlns="http://www.w3.org/1999/xhtml"> 請輸入所要移動的位元上移1下移上移2下移上移3下移上移4下移上移5下移上移6下移上移7下移上移8下移上移9下移上移10下移
Time of Update: 2018-12-08
animate( params, [duration], [easing], [callback] ) 用於建立自訂動畫的函數。 這個函數的關鍵在於指定動畫形式及結果樣式屬性對象。這個對象中每個屬性都表示一個可以變化的樣式屬性(如“height”、“top”或“opacity”)。注意:所有指定的屬性必須用駱駝形式,比如用marginLeft代替margin-left. 而每個屬性的值表示這個樣式屬性到多少時動畫結束。如果是一個數值,樣式屬性就會從當前的值漸層到指定的值。如果使用的是“hide”
Time of Update: 2018-12-08
複製代碼 代碼如下:<!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"> <head> <meta http-equiv="Content-Type" content="text/
Time of Update: 2018-12-08
複製代碼 代碼如下:$.validator.setDefaults({ submitHandler: function() { if ($("#username").val() != "" && $("#password").val() != "") { form1.submit(); } else { if ($("#password").val() == "") { $("#password").focus(); } if ($("#username").val() == "
Time of Update: 2018-12-08
今天晚上在操作兩個表時才發現兩個的區別。呵呵。 union 將兩個表串連後刪除其重複的項; union all 將兩個表串連都不刪除其重複的項。 這個東東很簡單。不過也記錄一哈 。實在是一個小小的收穫。 補充資料:資料庫中,UNION和UNION ALL都是將兩個結果集合并為一個,但這兩者從使用和效率上來說都有所不同。
Time of Update: 2018-12-08
複製代碼 代碼如下:function CheckTime() { var checkValue = new RegExp ("^\[0-2]{1}\[0-6]{1}:\[0-5]{1}\[0-9]{1}:\[0-5]{1}\[0-9]{1}") ; var stControl = document.getElementById("txtStartTime") ; var stValue = stControl.value ; if (stValue == "") {
Time of Update: 2018-12-08
除IE外的瀏覽器是將分行符號作為內容的文本節點(nodeType為3)。而元素的話,nodeType為1。下面是尋找它們的實用方法: 複製代碼 代碼如下:lastSibling:function(node){ var tempObj = node.parentNode.lastChild; while(tempObj.nodeType!=1 && tempObj.previousSibling!=null) { tempObj=tempObj.previousSibling; }
Time of Update: 2018-12-08
1、複選框全選操作:其實說到底就是對Jquery 選取器的運用,點我查看Jquery選取器 html代碼: 複製代碼 代碼如下:<form> 您愛好的運動是: <input type="checkbox" name="item" value="football"/> football <input type="checkbox" name="item" value="basketball"/> basketball <input