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>