send post data by XMLHttpRequest

   var url='http://localhost.bannieres/data/receive';
      var xhr = new XMLHttpRequest(); 
      xhr.open("POST",url,true);
      xhr.setRequestHeader("Content-type","application/x-www-form-urlencoded");
      xhr.send("data="+encodeURIComponent(payload.data));
here ,teh payload.data is set by this:

  data=JSON.stringify(data);
data is a string multi array.

评论

热门博文