Time of Update: 2018-12-05
1、JavaScript插入網頁下拉框內容<script language="JavaScript">function init_dl_servertype(){document.write("<option value='9'>GSM業務</option><option value='4'>193長途業務</option><option value='5'>165資料業務</option><option
Time of Update: 2018-12-05
<html><head><title></title><mce:style><!--a.parentlink{ text-decoration: none; color: #333333; font-size: 12px }a.parentlink:hover,a.childlink:hover { color: #000000; }a.childlink,td.childlink{ text-decoration: none;
Time of Update: 2018-12-05
下面是看視頻時做的練習,在這裡儲存一下<!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"
Time of Update: 2018-12-05
JavaScript和DOM中有很多類數組對象,它們有以下特點1、有length屬性2、可以使用[]通過下標訪問3、部分類數組對象使用[]訪問成員時不只可以使用下標,還可以使用id或name4、既然滿足了1、2條件,當然也可以通過for迴圈來遍曆但正如其名字,它們只是類似數組,而不是數組,並不能使用數組的特有方法,如slice、push、pop等。不過如果確實需要它們像數組一樣工作,可以使用Array.prototype.slice(類數組對象,
Time of Update: 2018-12-05
0> 函數的基本使用 window.onload = functionName; //函數載入,一般用在頁面的初始化載入中 escape(txt) //escape //*該函數可以處理空格、斜線和其他任何可能影響瀏覽器的內容, //並將它們轉換成 Web 可用字元(比如,空格會被轉換成 %20,
Time of Update: 2018-12-05
文章目錄 c{n}c{m,n}c{n,}*,+,?貪心與非貪心不記錄子Regex的匹配結果正向預查?!全域匹配,修飾符g不區分大小寫,修飾符i行首行尾,修飾符mexec方法的傳回值exec方法對Regex的更新match方法replace方法search方法和split方法 第一種方法:var reg = /pattern/;第二種方法:var reg = new
Time of Update: 2018-12-05
1 <a href="#" onclick="javascript:add();"> 因為href="#"這個元素會讓頁面自動跳到頂端,這樣頁面會跳動一下,沒有局部重新整理那種體驗 2將#去掉,剩下 href="",發現這樣也不行,這個會使整個頁面載入後還要再重新整理一次。 3,<a href="javascript:void(0)">。 JavaScript中void(0)的含義: JavaScript中void是一個操作符,該操作符指定要計算一個運算式但是不傳回值。
Time of Update: 2018-12-05
轉自:http://wangyong31893189.iteye.com/blog/1337023一、觸摸事件ontouchstartontouchmoveontouchendontouchcancel目前移動端瀏覽器均支援這4個觸摸事件,包括IE。由於觸屏也支援MouseEvent,因此他們的順序是需要注意的:touchstart → mouseover → mousemove → mousedown → mouseup → click1 /*** onTouchEvent*/var div
Time of Update: 2018-12-05
//json資料var data = "[{'PostId':'1','PostName':'專案經理'},{'PostId':'2','PostName':'品質員'},{'PostId':'3','PostName':'安全員'}]";//解析json資料var obj = eval('(' + data + ')');//使用解析後的資料var sel = document.getElementById("testAjaxSelect");for (var i = 0; i <
Time of Update: 2018-12-05
轉自:http://blog.csdn.net/sproy/article/details/6505144Javascript裡面的new Date("xxxx/xx/xx")這個日期的構造方法有一個妙處,當你傳入的是"xxxx/xx/0"(0號)的話,得到的日期是"xx"月的前一個 月的最後一天("xx"月的最大取值是69,題外話),如果傳入"1999/13/0",會得到"1998/12/31"。而且最大的好處是當你傳
Time of Update: 2018-12-05
javascript 實現 Unicode、ASCII相互轉換!有時會用到。 <html><head><meta http-equiv="Content-Type" content="text/html; charset=gb2312"><title>Unicode、ASCII相互轉換</title><script
Time of Update: 2018-12-05
函數對象是javascript 中一個很特殊的對象,其特殊體現在他的多重身份上。function Flower(){this.name="rose";this.color="red";}//Flower() 作為建構函式var obj=new Flower();//輸出 true, flower 作為類引用alert(obj instanceof Flower);function 關鍵字可以聲明普通函數,這一點和其他語言中函數的概念是相同的。
Time of Update: 2018-12-05
從 prototype.js 深入學習 javascript 的物件導向特性js是一門很強大的語言,靈活,方便。 目前我接觸到的語言當中,從文法角度上講,只有 Ruby 比它更爽。不過我接觸的動態語言只有: js ruby python flash的as 簡單的幾門, 應該算是井底之蛙之見。js 文法成分簡單,沒有 ruby 語言複雜。所以有時候我覺得她更乾淨(Ruby Fans 不要攻擊我哦,我也是很愛很愛很愛Ruby的)!prototype.js 無疑是
Time of Update: 2018-12-05
以下是javaScript中的String使用方法: String 類 Attribute and methodanchor() 建立一個<a>標籤的執行個體,將其name屬性設定為被傳遞給此方法的字串big() 將字串轉換為<big>標籤的一個執行個體blink() 將字串轉換為<blink>標籤的一個執行個體bold()
Time of Update: 2018-12-05
OperatorBinaryBase 二元操作符基類檔案:OperatorBinaryBase.js// ----------- Binary Operator Base -------------function OperatorBinaryBase() { this.DeriveFrom(new OperatorBase()); this.set_ClassName("OperatorAdd"); this._type = new
Time of Update: 2018-12-05
你可能知道,Javascript語言的執行環境是"單線程"(single
Time of Update: 2018-12-05
function CheckEmail()...{ var obj=document.getElementById("checkEmail"); var email=document.getElementById("TxtEmail").value; obj.className="Right"; obj.innerHTML='正在檢查,請稍候...'; if(email.length>0) ...{ var Expression=/^w+(
Time of Update: 2018-12-05
function CheckValidateCode()...{ var checkcode=document.getElementById("TxtValidateCode").value; if(checkcode.length>0) ...{ if(checking==true) ...{ checkValidateCode="false1"; SetCheckValidateCode(c
Time of Update: 2018-12-05
如果你是一個Web開發人員,應該也寫過這種接受使用者輸入的JavaScript代碼: <input type="text" name="age" onchange="return (this.value>0)">表面上看,這行代碼不存在任何問題,但實際運行一段時間後,卻發現它偶爾莫名其妙地罷工。 這行代碼的問題是,使用者不一定輸入標準的年齡整數,他可能輸入“23.5”,也可能輸入“二十三”。改正的辦法是加入一些轉換過程,例如: <input type="text"
Time of Update: 2018-12-05
// *******************************************************// replacements for unsupported array functions (because arrayname.push(var)// and arrayname.pop() are not implemented in IE until version 5.5)function thearrayisgood(thearray,i) { if