Warning: file_get_contents(/data/phpspider/zhask/data//catemap/1/php/293.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181
Javascript 为什么我的jquery帖子不发送数据?_Javascript_Php_Jquery_Ajax - Fatal编程技术网

Javascript 为什么我的jquery帖子不发送数据?

Javascript 为什么我的jquery帖子不发送数据?,javascript,php,jquery,ajax,Javascript,Php,Jquery,Ajax,我知道它没有发送post值,因为在我的php中,有一个echo语句没有被调用 function common_set_total(doc_string) { var parser = new DOMParser(); //create a new DOMParser var doc = parser.parseFromString(doc_string, "application/xml"); //convert the string to xml $.ajax ( {

我知道它没有发送post值,因为在我的php中,有一个echo语句没有被调用

function common_set_total(doc_string)
{
  var parser = new DOMParser(); //create a new DOMParser
  var doc = parser.parseFromString(doc_string, "application/xml"); //convert the string to xml
  $.ajax
  (
    {
      type: "POST",
      processData: false,
      url:  SITE_URL + "/system/xml/price",
      data: { xml: doc, apptype: "frame", session_id: session_id}
    }
  ).done(function( msg ) 
  {
      $("#total").html("$" + msg); //Set the total
  });

}

您是否检查了浏览器控制台以查看请求是否实际通过?会话id来自何处?为什么要将字符串转换为dom,然后在post中将其转换回字符串?我建议您也添加
$.ajax(…).done(…).fail(函数(jqXHR、textStatus、errorshorn){..将它们记录到控制台..})到您的呼叫。这可能会为您提供调试此文件所需的信息。@Eric Wu:它位于同一个域上。
function common_set_total(doc_string)
{
  $.ajax
  (
    {
      type: "POST",
      processData: false,
      url:  SITE_URL + "/system/xml/price",
      data: "xml=" + doc_string + "&apptype=frame&session_id=" + session_id
    }
  ).done(function( msg ) 
  {
      $("#total").html("$" + msg); //Set the total
  });

}