var arr = new Array(3)
arr[0] = "George"
arr[1] = "John"
arr[2] = "Thomas"
document.write(arr + "<br />")
document.write(arr.push("James") + "<br />")
document.write(arr)
//输出
George,John,Thomas
4
George,John,Thomas,James
var arr = new Array(3)
arr[0] = "George"
arr[1] = "John"
arr[2] = "Thomas"
document.write(arr.join("."))
//输出:
George.John.Thomas
xhr.setRequestHeader("Content-Type",application/json);
xhr.send(json.stringify({
keyword:'c',
other:'test'
}));
xhr.timeout=5000;
xhr.ontimeout=function(){
console.log('timeout!');
}