ajax get method

by Ramya 2010-01-30 09:58:12

ajax get method:

Use ajax get method to submit the values without reloading the page.

var browser = navigator.appName;
function createRequestObject()
{
var request_o; //declare the variable to hold the object.
if(browser == "Microsoft Internet Explorer")
{
/* Create the object using MSIE's method */
request_o = new ActiveXObject("Microsoft.XMLHTTP");
}
else
{
/* Create the object using other browser's method */
request_o = new XMLHttpRequest();
}
return request_o; //return the object
}
function ajaxa(param)
{
var str = "test.php?strng="+param;
httpa = createRequestObject();
httpa.open('get', str,true);

httpa.onreadystatechange = handleResponse;
/* Send the data. We use something other than null when we are sending using the POST
method. */
httpa.send(null); // Null for Get Method
}

Tagged in:

1314
like
0
dislike
0
mail
flag

You must LOGIN to add comments