Time of Update: 2018-12-07
function SetIFrameHeight(down) { var Sys = {}; var ua = navigator.userAgent.toLowerCase(); var s; (s = ua.match(/msie ([\d.]+)/)) ? Sys.ie = s[1] : (s = ua.match(/firefox\/([\d.]+)/)) ? Sys.firefox = s[1] : (
Time of Update: 2018-12-07
全域屬性和函數可用於所有內建的 JavaScript 對象。頂層函數(全域函數)FF: Firefox, IE: Internet Explorer函數描述FFIEdecodeURI()解碼某個編碼的 URI。15.5decodeURIComponent()解碼一個編碼的 URI 組件。15.5encodeURI()把字串編碼為 URI。15.5encodeURIComponent()把字串編碼為 URI 組件。15.5escape()對字串進行編碼。13eval()計算 JavaScript
Time of Update: 2018-12-07
通過對javascript的幾種函數的運行分析,得出結論:javascript 的繼承實際上是通過對對象進行初始化來類比的。代碼一:實現繼承的一種方法<script language="javascript" type="text/livescript">function Person(){ this.say=function(){alert("Name")};}function PersonA(){ this.say=function(){alert("windowSa
Time of Update: 2018-12-07
javascript物件導向繼承的三種方法:<html xmlns="http://www.w3.org/1999/xhtml" ><head runat="server"> <title>Untitled Page</title> <script language="javascript" type="text/javascript"> //基類 function Person() { th
Time of Update: 2018-12-07
第一方法就是在CSS裡面定義#xxx { cursor: default; } 第二方法就是在style中定義 列舉比較常用的cursor: hand;手型cursor: default;最常用的箭頭狀 cursor: text;文本 crosshair: 十字 cursor: wait;漏鬥 cursor: help;問號 cursor: e-resize;左右箭頭 多用於拖拉層效果 cursor: ne-resize; 拉視窗的樣式 cursor: n-resize;上下箭頭
Time of Update: 2018-12-07
1、escape對ansi碼0-255以外的字元進行編碼輸出%u****格式即unicode值,escape 方法返回一個包含了 charstring 內容的字串值( Unicode 格式)。所有空格、標點、重音符號以及其他非 ASCII 字元都用 %xx 編碼代替,其中 xx 等於表示該字元的十六進位數。例如,空格返回的是 "%20" escape不編碼字元有69個:*,+,-,.,/,@,_,0-9,a-z,A-Z 2、encodeURI類似escape,用於地址欄編碼
Time of Update: 2018-12-07
10款令人驚奇的HTML5和javascript效果。回到幾年前,這些效果是根本不可能實現,只能用flash做,但是現在,已經很輕鬆的就可以實現了。1. Breathing Galaxies使用鍵盤來改變形狀中的線條樣式,或移動滑鼠來建立一個新的形狀。查看:http://mudcu.be/labs/JS1k/BreathingGalaxies.html2. Noise
Time of Update: 2018-12-07
//判斷瀏覽器 //----------------------------- 判斷瀏覽器 -------------------------var userAgent = navigator.userAgent; //取得瀏覽器的userAgent字串var isOpera = userAgent.indexOf("Opera") > -1; //判斷是否Operavar isMaxthon = userAgent.indexOf("Maxthon") > -1 ;
Time of Update: 2018-12-07
IFrame高度自適應的設定代碼。function SetIFrameHeight(down) {var Sys = {};var ua = navigator.userAgent.toLowerCase();var s;(s = ua.match(/msie ([\d.]+)/)) ? Sys.ie = s[1] :(s = ua.match(/firefox\/([\d.]+)/)) ? Sys.firefox = s[1] :(s = ua.match(/chrome\/([\d.]+)
Time of Update: 2018-12-07
首先,給大家道個歉,專欄更新的晚了。理由借口神馬的就不多說了......字串的比較 ==相等!=不相等===絕對相等!==不絕對相等>大於>=大於等於<小於<=小於等於 是否相等 var str1="JavaScript";var str2="JAVASCRIPT";document.write("str1="+str1);document.write("<br/>");document.write("str2="+str2);document.write(
Time of Update: 2018-12-07
RegExp 對象RegExp 對象表示Regex,它是對字串執行模式比對的強大工具。直接量文法/pattern/attributes建立 RegExp 對象的文法:new RegExp(pattern, attributes);參數參數 pattern 是一個字串,指定了Regex的模式或其他Regex。參數 attributes 是一個可選的字串,包含屬性 "g"、"i" 和 "m",分別用於指定全域匹配、區分大小寫匹配和多行匹配。ECMAScript 標準化之前,不支援 m
Time of Update: 2018-12-07
Math 對象Math 對象用於執行數學任務。使用 Math 的屬性和方法的文法:var pi_value=Math.PI;var sqrt_value=Math.sqrt(15);注釋:Math 對象並不像 Date 和 String 那樣是對象的類,因此沒有建構函式 Math(),像 Math.sin() 這樣的函數只是函數,不是某個對象的方法。您無需建立它,通過把 Math 作為對象使用就可以調用其所有屬性和方法。Math 對象屬性FF: Firefox, IE: Internet
Time of Update: 2018-12-07
MainActivity如下:package cn.testjavascript;import android.os.Bundle;import android.view.View;import android.view.View.OnClickListener;import android.webkit.WebView;import android.widget.Button;import android.app.Activity;/** * Demo描述: *
Time of Update: 2018-12-07
Number 對象Number 對象是原始數值的封裝對象。建立 Number 對象的文法:var myNum=new Number(value);var myNum=Number(value);參數參數 value 是要建立的 Number 對象的數值,或是要轉換成數位值。傳回值當 Number() 和運算子 new 一起作為建構函式使用時,它返回一個新建立的 Number 對象。如果不用 new 運算子,把 Number()
Time of Update: 2018-12-07
String 對象String 對象用於處理文本(字串)。建立 String 對象的文法:new String(s);String(s);參數參數 s 是要儲存在 String 對象中或轉換成原始字串的值。傳回值當 String() 和運算子 new 一起作為建構函式使用時,它返回一個新建立的 String 對象,存放的是字串 s 或 s的字串表示。當不用 new 運算子調用 String() 時,它只把 s 轉換成原始的字串,並返迴轉換後的值。String 對象屬性FF: Firefox,
Time of Update: 2018-12-07
第三章
Time of Update: 2018-12-07
MainAcivity如下:package cn.testjavascriptdialog;import android.os.Bundle;import android.app.Activity;import android.app.AlertDialog;import android.app.AlertDialog.Builder;import android.app.Dialog;import android.content.DialogInterface;import
Time of Update: 2018-12-07
MainActivity如下:package cn.testjavascript;import android.os.Bundle;import android.webkit.WebChromeClient;import android.webkit.WebView;import android.app.Activity;/** * Demo描述: * JavaScript調用Android中的方法 * 即點擊Html中按鈕,調用Android中的方法 * * 參考資料: *
Time of Update: 2018-12-07
Time of Update: 2018-12-07
String對象有許多的方法,因此我們這裡的討論範圍只限於其中的兩個,indexOf()和