Time of Update: 2018-12-03
"#"包含了一個位置資訊預設的錨點是#top 也就是網頁的上端而javascript:void(0) 僅僅表示一個死連結這就是為什麼有的時候頁面很長瀏覽連結明明是#可是跳動到了頁首,而javascript:void(0) 則不是如此所以呼叫指令碼的時候最好用void(0)或者<input onclick><div onclick>等開啟新視窗連結的幾種辦法1.window.open('url')2.用自訂函數<script>function openWin(
Time of Update: 2018-12-03
這裡起主要作用的是setTimeout這個函數。<!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-03
閱讀本文之前,請先看下面一道題:題目17:Read the following javascript code: var someText="web2.0 .net2.0";var pattern=/(\w+)(\d)\.(\d)/g;var outCome_exec=pattern.exec(someText);var outCome_matc=someText.match(pattern);What is outCome_exec[1] and
Time of Update: 2018-12-03
驗證表單中的文本輸入欄位<script language="javascript">//判斷是否為英文字母function isEnglish(name){if(0 == name.length){return false;}for(i=0; i<name.length; i++){if(65>name.charCodeAt(i) || 128<name.charCodeAt(i)){return false;}}return
Time of Update: 2018-12-04
<html> <head> <base href="<%=basePath%>"> <title>收藏_列印_郵件_設為首頁</title><meta http-equiv="pragma" content="no-cache"><meta http-equiv="cache-control" content="no-cache"><meta
Time of Update: 2018-12-03
function round(v,e) { var t=1; for(;e>0;t*=10,e--); for(;e<0;t/=10,e++); return Math.round(v*t)/t; } function FormatNumber(srcStr,nAfterDot){ var srcStr,nAfterDot; var resultStr,nTen; srcStr = ""+srcStr+"";
Time of Update: 2018-12-03
<script language="javascript"> message="1、歡迎使用...系統!^" + "2、希望您能夠提出您的寶貴意見和建議!^" +"3、我的連絡方式:vipdingy@126.com ^" + "^"; scrollspeed=35; linedelay=3500; text=""; function scrollText(pos) { if(message.charAt(pos)!="^") {
Time of Update: 2018-12-03
來源:http://www.laruence.com/2009/09/08/1076.html Javascript是一種很靈活的語言, 而This關鍵字又是靈活中的靈活, 但是因為它的靈活, 也註定了它的難用.以前我用this的時候, 都會覺得不踏實, 老是擔心它不知道怎麼地就會指到另外的什麼地方.其實, 這都是因為, 我們對它的不瞭解.剛好最近再給百度學院做《Javascript進階-範圍/原型鏈》的ppt, 而swit1983網友也剛好提這個問題, 索性就把這部分內容獨立總結出來,
Time of Update: 2018-12-03
<html><head> <title>Parasitic Combination Inheritance Example</title> <script type="text/javascript"> function object(o){ function F(){} F.prototype = o; return
Time of Update: 2018-12-03
1、按鈕為button,可在js中調用formName.submit()顯性提交。若是submit按鈕,則不能再這樣加提交語句,否則會提交兩次。2、一個input域中斷行符號,會預設第一個submit屬性的按鈕提交。若都是butoon屬性,則斷行符號不會提交表單。3、有時提交表單後不能重新整理頁面,即沒有action=""的情況,<form name="hand" method="post" onSubmit="javascript:return
Time of Update: 2018-12-03
最近為了增加項目中某模組的視覺效果和操作的方便性,在項目中使用了jquery控制項jquery-week-calendar,在做完資料互動後,發現在IE6上速度非常的慢,在IE7或是IE8上的效果也不盡人意。在Firefox
Time of Update: 2018-12-03
即時給XML文檔載入XSL需要在程式中建立四個對象,我們用Javascript 作為開發語言來談談對這四個對象的使用,其中用於建立XSL檔案和XML檔案的訪問對象需要使用多線程。//建立XSL檔案的多線程DOM對象var xslDoc=new ActiveXObject("Msxml2.freethreaderDomdocument.4.0");xslDoc.async=false;xslDoc.load("product.xsl");//建立緩衝模版對象var xslt=new
Time of Update: 2018-12-03
依照標題,本片部落格介紹這個小例子。下面部落格總結js物件導向知識。 我們做這個小例子的目的就是理解js物件導向的知識。先拿個例子試試手,然後再比較系統的總結下。這塊兒知識在看視頻的時候,感覺看的效果不是很好,很多都是聽的雲裡霧裡的。 在做這個例子的時候,感覺很彆扭。因為JavaScript語言大多情況下是沒有智能提示的。而且firebug調試工具也用的不是很好,還在適應期;錯誤控制台的資訊全是英文的,不能夠及時準確的發現錯誤。
Time of Update: 2018-12-03
由於剛開始學習B/S編程,下面對各種指令碼語言有一個宏觀的簡單認識。指令碼語言(JavaScript,Vbscript,JScript等)介於HTML和C,C++,Java,C#等程式設計語言之間。它的優勢在於代碼執行時不用像程式設計語言那樣必須經過“編譯”,先產生二進位機器碼再執行,而是由其所對應的解譯器(或稱虛擬機器)直接解釋執行。程式碼既是指令碼程式,亦是最終可執行檔。曆史:JavaScript是一種指令碼語言。前身為LiveScript,是Netscape開發的一種描述式語言。自Sun公
Time of Update: 2018-12-03
轉自:http://stackoverflow.com/questions/6750880/javascript-how-does-new-work-internallyThe new operator uses the internal [[Construct]] method, and it basically does the following:Initializes a new native objectSets the internal [[Prototype]] of this
Time of Update: 2018-12-04
Regex在Javascript裡,有兩種使用正則的方法,一是建立一個Regex的執行個體,而是使用String對象裡的正則表達相關的方法.[Edit Regex對象]Regex對象[Edit 兩種建立方法]兩種建立方法:var my_regex=/[a-z]+/g; var my_regex=/^[_a-z0-9]+@([_a-z0-9]+/.)+[a-z0-9]{2,3}$/;var my_regex=new ("[a-z]+","g");[Edit
Time of Update: 2018-12-04
轉載自:http://www.cnblogs.com/leadzen/archive/2008/09/06/1285764.html <script type="text/javascript"> var Sys = {}; var ua = navigator.userAgent.toLowerCase(); var s; (s = ua.match(/msie ([\d.]+)/)) ? Sys.ie = s[1] :
Time of Update: 2018-12-04
<script type="text/javascript">// 去左右空格 function trim(str){return str.replace(/^\s+|\s+$/g,'');}var powers=new Array("7","9","10","5","8","4","2","1","6","3","7","9","10","5","8","4","2"); var parityBit=new Array("1","0","X","9","8","
Time of Update: 2018-12-04
/* *非同步js 擴充載入標識 *@author */(function($){if($.fn.async) {return;}if(!document.body) {document.write("<body/>");}$.fn.extend({async : function(url,obj,callback) {//非同步路徑,指定非同步返回資料填充的div,回呼函數if(!this) {alert("對象未找到...");return;}var
Time of Update: 2018-12-04
轉載自:http://apps.hi.baidu.com/share/detail/5472492多張圖片切換javascript例子,可以選擇切換的樣式,不過不能選擇指定的圖片<table width="535" height="215" border="0" cellpadding="0"cellspacing="0"><tr><td width="450" height="215"><mce:script