1.for post with json
var json={jsonname:"jsonvalue"};
xhr = new XMLHttpRequest(); xhr.open("post", "GetJson", true); xhr.setRequestHeader("Content-Type", "application/x-www-form-urlencoded");
xhr.send("json="+json);
2.avoid web cache when get the same url using the same params
var json={jsonname:"jsonvalue"}; xhr = new XMLHttpRequest(); xhr.open("get", "GetJson", true); xhr.setRequestHeader('If-Modified-Since', '0'); xhr.send("json="+json);