var ajax = new XMLHttpRequest();
ajax.open('POST', 'hello.php', false);
ajax.setRequestHeader('Content-type', 'application/x-www-form-urlencoded');
// below is data you send
ajax.send('name=luna&city=denpasar');
With ajax, you can also get info response from server:
var content_length = ajax.getResponseHeader('Content-length');
No comments:
Post a Comment