Time of Update: 2018-12-03
var Supplier_LastSelectRowId = ""; function Supplier_selectRow(sender) { if(Supplier_LastSelectRowId != "") { var lastSelectRow = window.document.getElementById(Supplier_LastSelectRowId); if (lastSelectRow != null) {
Time of Update: 2018-12-03
<html><head><script language='javascript'><!--function issueCommand(x){ if (document.layers) { if (x.which==99||x.which==67) window.close(); else if (event.keyCode==112||event.keyCode==80)
Time of Update: 2018-12-03
JS代碼:function checkContentKeyUp(){var content=document.getElementById('content');var length=content.value.length;var contentMsg = document.getElementById('contentMsg');contentMsg.innerHTML = "您已輸入<font color='red'>"+ length+
Time of Update: 2018-12-03
有部分有錯誤,自己找一下,鍛煉一:)//取得網路上的印表機function getnetprinter(){var obj=new ActiveXObject("WScript.Network");var netprinter=obj.EnumPrinterConnections(); for(i=0;i {document.writeln(netprinter.Item(i)+"="+netprinter.Item(i+1));}}//取得磁碟資訊 傳入參數如:getdiskinfo('c')
Time of Update: 2018-12-03
最近接觸了一些JS相關的架構組件,如JQuery等,瞭解了別人寫的一些代碼,自己也加以學習總結,覺得有些JS代碼的寫法真的是非常巧妙。現把一些總結的編碼技巧記錄如下,以作備忘:技巧1:擷取預設值:var v = arg || defaultValue;代碼註解:“arg”為一個運算式。當“arg”為“undefined”或“null”時,轉換為boolean類型為假,程式會繼續計算運算式“defaultValue”的值,整個運算式的值將是“defaultValue”。當“arg”轉換為boole
Time of Update: 2018-12-03
<!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>test Cookie</title> <link
Time of Update: 2018-12-03
↑→40種網頁常用小技巧(javascript)←↓------[不時之需]1. oncontextmenu="window.event.returnValue=false" 將徹底屏蔽滑鼠右鍵<table border oncontextmenu=return(false)><td>no</table> 可用於Table2. <body onselectstart="return false"> 取消選取、防止複製3. onpaste="retu
Time of Update: 2018-12-03
JavaScript注釋文法//注釋內容/*注釋內容 */JavaScript注釋樣本使用兩個雙斜杠注釋行//document.write("www.dreamdu.com");使用斜杠星注釋代碼塊(多行)/*var dreamdu = "www.dreamdu.com";var dreamdu = "du"; */提示: 過多的JavaScript注釋會降低JavaScript的執行速度與載入速度,因此應在發布網站時,去掉JavaScript注釋。提示: 註解區塊(/* ...
Time of Update: 2018-12-03
21.讓快顯視窗總是在最上面:<body onblur="this.focus();">22.不要捲軸? 讓豎條沒有: <body style="overflow:scroll;overflow-y:hidden"> </body> 讓橫條沒有: <body style="overflow:scroll;overflow-x:hidden"> </body> 兩個都去掉?更簡單了 <body scroll="no">
Time of Update: 2018-12-03
1. oncontextmenu="window.event.returnValue=false" 將徹底屏蔽滑鼠右鍵<table border oncontextmenu=return(false)><td>no</table> 可用於Table2. <body onselectstart="return false"> 取消選取、防止複製3. onpaste="return false" 不準粘貼4. oncopy="return false;
Time of Update: 2018-12-03
javascript中的null 和 undefined,總是困擾著我,下面總結如下,以備查詢。在JSON裡面,如果沒有這個節點,你卻用到了這個節點的某個屬性,就會出錯,但不報錯。正確的辦法是先判斷是否有該節點,然後再判斷屬性。1、節點的判斷是用 null 。可以寫 : if ( ! Nodeselect )。這就表示不為null 了,也可以寫為 !==null,但有時會出錯。2、對於JSON的屬性,如果有節點,那麼他的這個屬性,無論是否設定了,其也不會報錯,因為他會輸出值:undefined。
Time of Update: 2018-12-03
javascript是一門太過靈活的函數語言,其語言機制本身並沒有提供完整的物件導向實現(沒有類,繼承等概念),但憑藉其靈活的文法,仍然可以在一定程度上實現OOP。比如類的概念,可以通過以下文法來實作類別TestA:TestA = function(nValue) { this.m_nValue = nValue; this.funcA = function() { alert("funcA:" + this.m_nValue); }}TestA類的使用方法如下:
Time of Update: 2018-12-03
一個簡單的Javascript日誌控制台,能動態地在當前頁面中添加一個視窗半透明效果。初始化代碼如下: JSLogger.enable(true);而在js代碼中使用 JSLogger.debug( "your log message");就可以將日誌記錄到該視窗中。下面是該Logger的示範(注意看最左側的側邊欄,按一下滑鼠可切換)記錄 附上幾幅實際應用中的:日誌視窗的如下按一下滑鼠可以縮小到側邊欄(如)完整的JSLogger實現如下:JSLogger = function(){
Time of Update: 2018-12-03
發現日期:2005-9-23IE版本:6.0.3790.0描述:錯誤識別出現在javascript指令碼中的</script>字串,導致HTML標籤解析錯誤情境:HTML代碼:<script language='javascript'> w = window.createPopup(); ct = w.document.body; ct.style.border = "none"; ct.innerHTML += "<script
Time of Update: 2018-12-03
<!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/html;
Time of Update: 2018-12-03
寫下一個關於用Regex驗證表單的代碼,以後可以用到。function checkform(){var null_regu = /^[ ]*$/;var age_regu = /^[1-9][0-9]$/;var tel_regu = /^[0-9]*(-){0,1}[0-9]{8,11}$/;var email_regu=/^[/w]+[/w-/.]*@([/w]+/.)+[/w]+$/;var qq_regu=/^(/d+){6,12}/;if(new
Time of Update: 2018-12-03
<script> var ZoomStutas; var dragapproved=false; var z,x,y,temp1,temp2; var count = 10; function ZoomIn() { IMG.style.cursor="Images/ZoomIn1.ICO ZoomStutas="ZoomIn"; } function ZoomOut() { IMG.style.cursor="Images/
Time of Update: 2018-12-03
Esri為iOS、Android、Windows Phone提供了相應的API,GIS開發人員需要針對不同的平台,使用不同的ArcGIS移動API進行同一款移動GIS應用的開發,不僅提高了開發成本,加大了開發難度,也造成了資源、人力的浪費。 那麼能不能一次開發就可以應用到各個移動終端呢?雖然現在移動Web應用還沒有興起,但是答案是肯定的:HTML5+JQuery+PhoneGap實現跨平台、跨終端的應用開發,可以讓我們只學一種技術來開發一個在所有手機平台、平板電腦、
Time of Update: 2018-12-03
使用者在使用server的時候可能會發現在REST地址中的javascript方式瀏覽地圖,需要計算在連網的情況下才能使用,原因是調用了線上的javascript API導致的,接下來我們來看如何讓server使用本地的API。 首先下載JS
Time of Update: 2018-12-03
一個ArcGIS Javascript Viewer for JavaScript Widget是一組可以共用、遷移及部署到JavaScript View程式中的的文字檔。通常,一個程式員如果要開發一個或者一組Widgets會將他們封閉成一在一個Dojo模型中,如所示: