views:

69

answers:

2
var xmlHttp;

function RefreshORP(eventTarget, eventArgument)
{

  xmlHttp = GetXmlHttpObject();
  if(xmlHttp == null)
  {
    return true;
  }

  xmlHttp.onreadystatechange = StateChanged;

  var params = GetFormParam(eventTarget,eventArgument); 

  xmlHttp.open("POST","/contact.jsp",true);

  xmlHttp.setRequestHeader("Content-type", "application/x-www-form-urlencoded");

  xmlHttp.setRequestHeader("ajaxcall", "true");

  xmlHttp.send(params);
}
+1  A: 

Does this help you?

Xpto
+6  A: 

In jQuery you have it all done...

$.post("/contact.jsp", $("formID").serialize(), function(data){
    // process callback
});

jQuery will also set all appropriate (and somehow standardized) request headers.

Robert Koritnik