Different ways to pass XML via jQuery AJAX

后端 未结 3 1917
萌比男神i
萌比男神i 2020-12-19 07:22

I\'m facing a problem to get return value (content-type: \"text/xml\"). I\'m able to get return value by direct access this URL:

https://[domain_name]/myfolder

3条回答
  •  一向
    一向 (楼主)
    2020-12-19 08:08

    To simplify, I would do the following

    Lets assume you are using a php script called script.php.

    var xml_string = "";
    
    $.get('script.php', {xml: xml_string}, function(){ //your success function
      alert('success');
    }).error(function(){ //your error function
      alert("error");
    });
    

提交回复
热议问题