Jan Hancic is right: the best way is to use XMLHttpRequest.
Here is an example:
var xhr = new XMLHttpRequest(); xhr.open("post", "http://ex.ample.com/file.php", true); xhr.onreadystatechange = function() { if(this.readyState == 4) {
There are many guides and links on the Internet about AJAX and the xhr object.
source share