简体   繁体   English

尽管从服务器发送了响应数据,但 JSON 请求仍直接跳转到错误语句

[英]JSON request jumping directly to error statement despite having response data sent from server

Background :背景 :

this is a simple ajax request to fetch data from database, my query and server side code works just fine.这是一个从数据库中获取数据的简单 ajax 请求,我的查询和服务器端代码工作正常。

Problem :问题 :

When i put the GET URL in my browser it shows the correct JSON response, but firebug (Firefox extension) doesn't show any response, and the error message is logged.当我将 GET URL 放入浏览器时,它会显示正确的 JSON 响应,但 firebug(Firefox 扩展程序)没有显示任何响应,并且会记录错误消息。

alert('success'); doesn't show不显示

$('#loadOrderDetails').click(function () {
 var id = document.getElementById("order_id").value;
 var dataString = 'order_id=' + id ;
  alert(dataString);
    $.ajax({
    type: "GET",
    url: "index.php?route=new/orders/GetOrder",
    data: dataString,
    cache: false,
    dataType: 'json',
    success: function (data) {
    alert ('success');
   // my code to show data in table..
                  },
                  error: function (req, status, err) {
                      console.log('something went wrong', status, err);
                  }
              })
          });

any suggestions?有什么建议?

谢谢大家,我的问题似乎是因为 www ,我在服务器设置中解决了它。

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM