i am trying to Use this
function GetXmlHttpObject()
{
if (window.XMLHttpRequest)
{
// code for IE7+, Firefox, Chrome, Opera, Safari
return new XMLHttpR
This is really easy:
var url="myPhp.php?param1="+ param1 + "¶m2=" + param2
However you might consider using jQuery.
As it would become even easier ;)
To have a complete ajax call you need only one method call without having to care about browser issues. So your code becomes a lot easier to read.
$.ajax({
// you can use post and get:
type: "POST",
// your url
url: "some.php",
// your arguments
data: {name : "John", location : "Boston"},
// callback for a server message:
success: function( msg ){
alert( "Data Saved: " + msg );
},
// callback for a server error message or a ajax error
error: function( msg )
{
alert( "Data was not saved: " + msg );
}
});