1
<script type="text/javascript">
function dialogsf() {
     $("#loadingsf").dialog({
         hide: 'slide',
         show: 'slide',
         autoOpen: true
     });
     $("#loadingsf").dialog('open').html("<p>Please Wait while contacts are imported...</p>");
     //alert("dfsd");
 }
 var fd = 1;
 $(document).ready(function () {
     dialogsf();
     $.ajax({
         url: "get_contacts.php",
         type: "GET",
         data: {
             sid: 'a'
         },
         processData: false,
         contentType: false,
         success: function (response) {
             // alert("Import done successfully with "+contacts.length+ " contacts");
             alert("Import done successfully");
             $('#loadingsf').html("<p>Result Complete...</p>");
         }
     }).fail(function (xhr, status, error) {
         alert('error:' + status + ':' + error + ':' + xhr.responseText)

     }).done(function (respond) {
         location.href = respond;

     });

 });
</script>
    <body >
    <div id="loadingsf" title="SF Contact Import"> 
    <p>Please wait ...</p>
</div>

这是我正在处理的片段。当我运行特定页面时,我得到了这个"error:error::" 不确定为什么 ajax 调用总是失败并且控制台也是空的

4

1 回答 1

0

删除contentType:false或设置正确的 contentType 为contentType: "application/json"

于 2013-09-04T11:21:59.717 回答