Time of Update: 2018-12-05
學習物件導向的借書小例子,理解實體類和物件導向思想。 代碼Code highlighting produced by Actipro CodeHighlighter (freeware)http://www.CodeHighlighter.com/-->function BookData(BId, BName, BHasOut, BPrice) { ///實體物件 this.Id = BId; this.Name = BName; this.HasOut = BHasOut;
Time of Update: 2018-12-05
<%@LANGUAGE="JAVASCRIPT" CODEPAGE="936"%><!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-e
Time of Update: 2018-12-05
這篇文章將詳細描述應用Javascript製作兩種類型的進度條,並且將核心程式碼封裝裝起來。放在percent.js/** * 繪製簡單百分比進度條 * barId 進度條span的ID * fPercent 完成的百分數 * strCaption 標題 * iHeight 高度 * iUnit 最小單位 * bgcolor 背景顏色 * border 邊框樣式 * cursor 游標樣式 */function SimplePercent(barId, fPercent, strCaption,
Time of Update: 2018-12-05
如果你的電腦、IE不能運行Javascript代碼,而且在設定工具-->Inerter選項-->安全裡面啟用Javascript後還不能用,你可以試一下下面的方法。建立一個ierepar.txt文檔,將下面的內容複寫進去,然後重新命名為ierepar.bat。雙擊此檔案運行批處理,結束後就可以恢複了。regsvr32 actxprxy.dll /sregsvr32 shdocvw.dll /sRegsvr32 URLMON.DLL /sRegsvr32 actxprxy.dll
Time of Update: 2018-12-05
這種轉換主要用來加密js代碼. 這兩個函數參考了[指令碼之家] (http://www.jb51.net/html/200707/23/10560.htm ) 的代碼, 但是他的函數是錯的, 我不知道為什麼那個作者要那樣寫, 所以我改寫了一下 .function unicode2Chr(str) { if (str!='') { var fret, tempStr; fret = ''; for (var i = 1; i <= str.length/4; i ++) {
Time of Update: 2018-12-05
<script language="javascript" type="text/javascript"> function show() { if (document.getElementById("<%=RBut1.ClientID%>").checked == true) {
Time of Update: 2018-12-05
javascript在中ie與firefox的區別與解決方案1.載入xmlie建立對象: msXmlAx=new ActiveXObject("Microsoft.XMLDOM");firefox建立對象: xDoc=document.implementation.createDocument("","",null);總體方法為: ///判斷瀏覽器 建立不同的對象 function getXmlDocument() { var xDoc;
Time of Update: 2018-12-05
IE和Firefox在JavaScript方面的相容性2008-01-05 13:151.document.formName.item("itemName") 問題 說明: IE下,可以使用document.formName.item("itemName")或document.formName.elements["elementName"];
Time of Update: 2018-12-05
<script language=javascript> function checkPassWordLevel(o) { var n=0; if (/\d/.test(o.value)) n ++;//包含數字 if (/[a-z]/.test(o.value)) n ++;//包含小寫字母 if (/[A-Z]/.test(o.value)) n ++;//包含大寫字母 if (/\W/.test(o.value)) n ++;//包含其他字元 if (
Time of Update: 2018-12-05
1. 檢查一段字串是否全由數字組成 1<script language="Javascript"> 2<!-- 3 function checkNum(str) 4 { 5 return str.match(//D/)==null 6 } 7 alert(checkNum("1232142141")) 8 alert(checkNum("123214214a1")) 9-->10</script> 112.
Time of Update: 2018-12-05
<script language = "vbscript" runat = "server"> sub application_onstart '取的計數檔案的真實路徑 countfile=server.mappath("count.txt") '建立檔案系統對象執行個體
Time of Update: 2018-12-05
使用Javascript做小數(浮點數)加法運算時,小數位元不精確(舉例:2.01+90.01=92.02000000000001)。可以使用下面的函數解決此問題: //加法函數,用來得到精確的加法結果//說明:javascript的加法結果會有誤差,在兩個浮點數相加的時候會比較明顯。這個函數返回較為精確的加法結果。//調用:FloatAdd(arg1,arg2)//傳回值:arg1加上arg2的精確結果function FloatAdd(arg1,arg2){ var r1,r2,m;
Time of Update: 2018-12-05
在使用JavaScript操作XML對象時,經常我們會使用XPath來尋找被操作的XML節點,但有時會在調用selectNodes/selectSingleNode方法後出現“方法未知。”這個錯,如果你確定使用的方法名拼字正確,並且在W3C規定的方法列表中(http://www.w3.org/TR/xpath#section-Node-Set-Functions)的情況下,可以試試以下方法解決這個問題:即在我們通常的建立XML對象代碼中,加入XmlDomObj.setProperty("Sele
Time of Update: 2018-12-05
http://www.cnblogs.com/tonyqus/archive/2005/05/18/158357.html 如果我們要在一個普通表單中用javascript動態添加一個option選項,我們會這樣寫:document.form1.list1.options[0]=new Option("A1","a1");假設現在有一個表單名字叫form1,其中有一個list1為列表。以上代碼如果在當前視窗調用,會添加一個text="A1",
Time of Update: 2018-12-05
在asp.net中時常需要調用js代碼,如果js寫在asp.net中,一般是不會出現亂碼的問題。因為他們具有相同的編碼。如果需要引用外部的javascript代碼就會有亂碼的風險了。一般情況下Asp.net和Javascript的頁面編碼不是GB2312就是Utf-8
Time of Update: 2018-12-05
javascript中的繼承和Closures實現繼承的兩種方法使用"call"函數,call允許我們在一個上下文環境中調用另外一個函數。我們在cat和dog類中調用animal類。Code highlighting produced by Actipro CodeHighlighter (freeware)http://www.CodeHighlighter.com/-->function Animal(name){ this.name = name; this.species =
Time of Update: 2018-12-05
<script type="text/javascript"> var PasswordStrength ={ Level : ["極佳","一般","較弱","太短"],//強度提示資訊 LevelValue : [15,10,5,0],//和上面提示資訊對應的強度值 Factor : [1,2,5],//強度加權數,分別為字母,數字,其它 KindFactor : [0,0,10
Time of Update: 2018-12-05
HTML DOM圖片翻轉效果Code highlighting produced by Actipro CodeHighlighter
Time of Update: 2018-12-05
製作一個簡單的FLV播放器很簡單 , 做功能強大的就心有餘而力不足了 . 經過google ,找到了一款開源的視頻播放器JW_FLV_Player, 也可以當MP3播放器 . javascritp可以方面的控制播放器 進行 播放/暫停 停止 提高音量 減少音量 前進n秒 後退n秒 等. 都封裝好 ,
Time of Update: 2018-12-05
在 Javascript 控制 Flash FLV視頻播放器 --國外開源 這篇文章介紹了JW_FLV_Player這個開源播放器,在使用的過程中還是遇到一些問題的。比如在申明flash object時,如果播放器嵌套在form裡面,就立即需要用