Vanilla 1.1.4 is a product of Lussumo. More Information: Documentation, Community Support.
<html>
<head>
<title>Simple Ajax Example</title>
<script language="Javascript">
function xmlhttpPost(strURL) {
var xmlHttpReq = false;
var self = this;
// Mozilla/Safari
if (window.XMLHttpRequest) {
self.xmlHttpReq = new XMLHttpRequest();
}
// IE
else if (window.ActiveXObject) {
self.xmlHttpReq = new ActiveXObject("Microsoft.XMLHTTP");
}
self.xmlHttpReq.open('POST', strURL, true);
self.xmlHttpReq.setRequestHeader('Content-Type', 'application/x-www-form-urlencoded');
self.xmlHttpReq.onreadystatechange = function() {
if (self.xmlHttpReq.readyState == 4) {
updatepage(self.xmlHttpReq.responseText);
}
}
self.xmlHttpReq.send(getquerystring());
}
function getquerystring() {
var form = document.forms['f1'];
qstr = "OK";
return qstr;
}
function updatepage(str){
document.getElementById("result").innerHTML = str;
}
</script>
</head>
<form name="f1">
<p>Press the button to load the search contents from google on this page. Search Keywords used are: ajax tutorial
<input value="Go" type="button" onclick='java script:xmlhttpPost("http://www.google.com.pk/search?hl=en&q=ajax+tutorial&btnG=Google+Search&meta=")'></p>There is a space between onclick="java script" remove it
<div id="result"></div>
</form>
</body>
</html>
1 to 3 of 3