?? mobile.js
字號:
<!--這里寫AJAX代碼!!-->
var req = false;
var i=0;
function show(){
var name = getValue("mobname");
if(name=="" || name==null){
document.all.mydiv.innerHTML= "";
return ;
}else{
var uri = "提交的Action"
send(uri);
}
}
function getValue(obj){
return document.getElementById(obj).value;
}
function createReq(){
if(window.XMLHttpRequest){
req = new XMLHttpRequest();
}else if(window.ActiveXObject){
try{
req = new ActiveXObject("Msxml2.XMLHTTP");
}catch(e){
req = new ActiveXObject("Microsoft");
}
}
}
function send(uri){
createReq();
req.open("GET",uri,true);
req.onreadystatechange = process;
req.send(null);
}
function process(){
if(req.readystate==4){
if(req.status ==200){
var res = req.responseText;
document.all.mydiv.innerHTML = res;
}
}
}
function over(obj){
obj.style.backgroundColor="yellow";
}
function out(obj){
obj.style.backgroundColor="white";
}
function search(obj){
document.all.name.value = obj.innerHTML;
mydiv.innerHTML ="";
}
function down(){
alert(event.keyCode);
var divs = document.getElementsByName("sid");
if(divs.length>0){
divs[i].style.backgroundColor="yellow";
if(event.keycode==40 && i <divs.length){
i = i+1;
divs[i].style.backgroundColor="yellow"
}
}else{
return ;
}
}
?? 快捷鍵說明
復制代碼
Ctrl + C
搜索代碼
Ctrl + F
全屏模式
F11
切換主題
Ctrl + Shift + D
顯示快捷鍵
?
增大字號
Ctrl + =
減小字號
Ctrl + -