?? map.js
字號:
/** NV pair object */
function NameValuePair(name, value) {
this.name = name;
this.value = value;
}
/** Simple Map object to store array of name/value pairs */
function Map() {
// Data members
this.index = 0;
this.map = new Array();
// Function members
this.get = MapGet;
this.put = MapPut;
this.toString = MapToString;
this.toTable = MapToTable;
}
/** get() */
function MapGet(name) {
for (var i=0; i < this.index; i++) {
if (this.map[i].name.match(name)) {
return this.map[i].value;
}
}
return '';
}
/** put() */
function MapPut(name, value) {
this.map[this.index++] = new NameValuePair(name, value);
}
/** To HTML string */
function MapToString() {
var res = '';
for (var i=0; i < this.index; i++) {
res = res + this.map[i].name+'='+this.map[i].value+'<BR>';
}
return res;
}
/** To HTML table */
function MapToTable() {
var res = '<table border=1 cellpadding=3>';
var styleDiv = "<div style=\"color:black; font-family:monospace; font-size:10pt; white-space:pre;\">"
for (var i=0; i < this.index; i++) {
res = res + '<tr><td bgColor=white>'+styleDiv+this.map[i].name+'</div></td><td bgColor=white>'+styleDiv+this.map[i].value+'</div></td></tr>';
}
res += '</table>'
return res;
}
?? 快捷鍵說明
復制代碼
Ctrl + C
搜索代碼
Ctrl + F
全屏模式
F11
切換主題
Ctrl + Shift + D
顯示快捷鍵
?
增大字號
Ctrl + =
減小字號
Ctrl + -