weixin_33743661 2015-10-29 10:46 采纳率: 0%
浏览 39

API中的解析器错误

I've been trying to connect to the buqzilla api to get the data related to my bug id. I'm getting a response code 200 and while debugging it is showing parser error. I've tried to replace the json formatted values but of no use.

There is also another error regarding the CORS.

Can someone please help with this.Thanks in Advance.

<!DOCTYPE html>
<html>

<body>
  <p id="demo"></p>
  <script type="text/javascript" src="http://ajax.googleapis.com/ajax/libs/jquery/1.3.2/jquery.min.js"></script>
  <script type="text/javascript" src="http://jquery-json.googlecode.com/files/jquery.json-1.3.min.js"></script>
  <script>
    function Call() {

      var requiredParameters = [{
        "Bugzilla_login": "@@email@@",
        "Bugzilla_password": "@@pwd@@",
        "include_fields": "id"
      }];

      var connectionObject = {
        params: JSON.stringify(requiredParameters)

      };

      var bugId = 19301;
      var urlx = "http://engbugzilla:9898/" + "bug/" + bugId;
      alert("here");
      debugger;
      $.ajax({

        type: "GET",
        async: true,
        url: urlx,
        contentType: "application/json",
        dataType: "jsonp",
        crossDomain: "true",
        data: connectionObject,
        success: function(data) {
          alert("json");
        },
        error: function(xhr, ajaxOptions, thrownError) {
          alert(thrownError);
          console.log(thrownError);
        }

      });

    }

    Call();
  </script>

</body>

</html>

</div>
  • 写回答

1条回答 默认 最新

  • weixin_33681778 2015-10-29 11:03
    关注

    As per Bugzilla API, I have done some changes to your urlx variable and make this working.

    Here is the working demo.

    Hope this is what you want!

    评论

报告相同问题?

悬赏问题

  • ¥15 我这模型写的不对吗?为什么lingo解出来的下面影子价格这一溜少一个变量
  • ¥50 树莓派安卓APK系统签名
  • ¥15 maple软件,用solve求反函数出现rootof,怎么办?
  • ¥65 汇编语言除法溢出问题
  • ¥15 Visual Studio问题
  • ¥20 求一个html代码,有偿
  • ¥100 关于使用MATLAB中copularnd函数的问题
  • ¥20 在虚拟机的pycharm上
  • ¥15 jupyterthemes 设置完毕后没有效果
  • ¥15 matlab图像高斯低通滤波