Time of Update: 2018-12-05
FunctionBase 函數基類檔案:FunctionBase.jsvar $FunctionMapper = [];// Global function mapperfunction $RegisterFunction(funcObj) { if ($FunctionMapper[funcObj.get_FunctionName().toLowerCase()] != null) throw new Exception(this, "$RegisterFunction:"
Time of Update: 2018-12-05
OperatorUnaryBase 一元操作符基底類型檔案: OperatorUnaryBase.jsfunction OperatorUnaryBase() { this.DeriveFrom(new OperatorBase()); this.set_ClassName("OperatorUnaryBase"); this._type = new
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
算術操作符包括 +、-、*、/、% 算術操作符檔案:OperatorMathematic.jsfunction OperatorMathematic() { this.DeriveFrom(new OperatorBinaryBase()); this.set_ClassName("OperatorMathematic"); this.set_Sign("undefined");};function OperatorAdd() { this.DeriveFrom(new
Time of Update: 2018-12-05
這裡對萬物之始Object進行改造,以形成自己的類型系統,方便後面的類型實現、識別、處理等等。 格式約定先說明一下格式約定:1. 全域常量定義:以字元'$'開始,全部大寫的格式。var $MY_CONST = "ABCDEFG"; 2. 全域函數定義:以字元'$'開始,首字母大寫的格式。function $A(arg) { ...}; 3. 類的定義:使用單字首大寫的格式。 function MyClass {}; 4.
Time of Update: 2018-12-05
比較操作符基類檔案:OperatorCompareBase.jsfunction OperatorCompareBase() { this.DeriveFrom(new OperatorBinaryBase()); this.set_ClassName("OperatorCompareBase"); this.set_Sign("OperatorCompareBase"); this._getTwoNumberOperands = function(operands) {
Time of Update: 2018-12-05
OperandBase 運算元基底類型檔案:OperandBase.js// JScript source code// ----------- OperandBase ---------------function OperandBase(arg) { this.set_ClassName("OperandBase"); this._type = "undefined"; this._value = null; if (arguments.length > 0)
Time of Update: 2018-12-05
邏輯操作符的基底類型邏輯操作符包括一元和二元類型,因此有兩個基底類型檔案:OperatorLogicBase.jsfunction OperatorBinaryLogicBase() { this.DeriveFrom(new OperatorBinaryBase()); this.set_ClassName("OperatorBinaryLogicBase"); this.set_Sign("undefined");};function
Time of Update: 2018-12-05
操作符優先順序定義檔案:OperatorBase.js// JScript source codevar $OperatorPriority = { // Logic "||": 0, "&&": 0, // Compare ">": 1, ">=": 1, "<": 1, "<=": 1, // Logic compute "|": 2, "&": 2, "^": 2,
Time of Update: 2018-12-05
位操作符的基底類型位操作符同樣有一元和二元類型檔案:OperatorBitwiseBase.jsfunction OperatorBinaryBitwiseBase() { this.DeriveFrom(new OperatorBinaryBase()); this.set_ClassName("OperatorBitwiseBase");};function OperatorUnaryBitwiseBase() { this.DeriveFrom(new
Time of Update: 2018-12-05
<script> var oRadios = document.getElementById('selectradio').getElementsByTagName('input'); for( var i = 0, len = oRadios.length; i < len; i++){ oRadios[i].onclick = function(){ var value = t
Time of Update: 2018-12-05
調試JavaScript可能是Web開發中最讓人鬱悶的事情。所以這裡我們絕定來尋找一些好的工具來協助大家調試。這裡是10款我們精選的基於瀏覽器的JS線上調試工具,希望大家喜歡! Online Debugging Tools1. PastebinPastebin是一個協作式的調試工具,協助你在IRC,IM或者訊息版上對話來分享和修改程式碼片段 2. JSON Formatter and
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
<!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-05
眾所周知,javascript是動態語言,而Singleton模式在動態語言中實現是比較困難的,不過可以利用javascript的閉包特性來實現Singleton模式。例如在我們HTML5電氣原理圖繪製項目中,需要一個Singleton來存放原點座標、螢幕尺寸等資訊,可以通過如下代碼實現:var gs_graph = new ( function() { this.publicMethod = function() { ...... }
Time of Update: 2018-12-05
通過JavaScript來調用com的方式,之前就因為項目需要,所以處理過,但是之前覺得沒有什麼所以也沒有記錄什麼的,昨天突然想找這方面的資料,結果一時間有些困難,現在講這些內容在整理一下,算是個備忘吧。 這兩種調用方式,可以說大同小異,主要區別在於如何找到這個com的組件,下面就介紹一下: 1、首先使用delphi建立一個com,這個com有一個方法:function Method1(const AData: WideString):
Time of Update: 2018-12-05
Javascript在HTML5到來之後,毫無疑問將成為一門重要的程式設計語言。而隨著Javascript
Time of Update: 2018-12-05
typeof運算子介紹:typeof 是一個一元運算,放在一個運算數之前,運算數可以是任意類型。它傳回值是一個字串,該字串說明運算數的類型。你知道下面typeof運算的結果嗎?typeof(1);typeof(NaN);typeof(Number.MIN_VALUE);typeof(Infinity);typeof("123");typeof(true);typeof(window);typeof(document);typeof(null);typeof(eval);typeof(Date);
Time of Update: 2018-12-05
軟體開發過程中,字串組合是經常的是情,我們先看一句常用的字串組合:var strName='張三';var strTableName='myTable';var strSql="select * from "+strTableName+" where name='"+strName+"'";顯然,這句話的目的是要得到:select * from myTable where name='張三' 我們再來看C#中的常用用法:string strName="張三";string
Time of Update: 2018-12-05
Date類型在指令碼語言中經常使用,我們通常用下面的方式聲明一個Date變數:var dt=new Date();dt為當前系統時間,但許多時候,我們需要將一個字串轉換為Date型,而中國人的習慣是年月日時分秒格式,如:var strDate='2010-10-5