晕 //试题一: Array.prototype.a=function(x){
for(var i=0;i<this.length;i++){
if(this[i]==x)
this.splice(i,1);
}
return this;
}//试题二:var a= function(x){
var obj = {};
for (var i in x) {
obj[i]=x[i];
}
return obj;
}//试题三:<form>
name<input type="text" id=a name=a onblur=a()><br>
address<input type="text" id=b name=b onblur=a()>
</form>
<script>
var a=document.getElementById("a")
var b=document.getElementById("b")
function a(){
var DataToSend = "name=" + a.value + "&address=" + b.value;var xmlhttp = new ActiveXObject("Microsoft.XMLHTTP");
xmlhttp.open("POST", "Receiver.asp", true);
xmlhttp.setRequestHeader("Content-Type", "application/x-www-form-urlencoded");
xmlhttp.send(DataToSend);
}
</script>
for(var i=0;i<this.length;i++){
if(this[i]==x)
this.splice(i,1);
}
return this;
}//试题二:var a= function(x){
var obj = {};
for (var i in x) {
obj[i]=x[i];
}
return obj;
}//试题三:<form>
name<input type="text" id=a name=a onblur=a()><br>
address<input type="text" id=b name=b onblur=a()>
</form>
<script>
var a=document.getElementById("a")
var b=document.getElementById("b")
function a(){
var DataToSend = "name=" + a.value + "&address=" + b.value;var xmlhttp = new ActiveXObject("Microsoft.XMLHTTP");
xmlhttp.open("POST", "Receiver.asp", true);
xmlhttp.setRequestHeader("Content-Type", "application/x-www-form-urlencoded");
xmlhttp.send(DataToSend);
}
</script>
for(var i=0;i<this.length;i++){
if(this[i]==x)
this.splice(i,1);
}
return this;
}
//试题二:
var a= function(x){
var obj = {};
for (var i in x) {
obj[i]=x[i];
}
return obj;
}
//试题三:
<form>
name<input type="text" id=a name=a onblur=a()><br>
address<input type="text" id=b name=b onblur=a()>
</form>
<script>
var a=document.getElementById("a")
var b=document.getElementById("b")
function a(){
var DataToSend = "name=" + a.value + "&address=" + b.value;var xmlhttp = new ActiveXObject("Microsoft.XMLHTTP");
xmlhttp.open("POST", "Receiver.asp", true);
xmlhttp.setRequestHeader("Content-Type", "application/x-www-form-urlencoded");
xmlhttp.send(DataToSend);
}
var regexp = /%20/g;
var DataToSend = "name=" + encodeURIComponent(a.value).replace(regexp,"+") + "&address=" + encodeURIComponent(b.value).replace(regexp,"+");就算鸡蛋里挑骨头了,楼主别介意。