Skip to content

Instantly share code, notes, and snippets.

@globau
Last active December 13, 2015 23:59
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save globau/4995830 to your computer and use it in GitHub Desktop.
Save globau/4995830 to your computer and use it in GitHub Desktop.
bugzilla jsonp
function show_bug_info(bug_id) {
var params = [{
"ids": [ bug_id ]
}];
var request = {
"method": "Bug.get",
"params": JSON.stringify(params)
};
$.ajax({
"contentType": "application/json",
"data": request,
"crossDomain": "true",
"dataType": "jsonp",
"url": "https://bugzilla.mozilla.org/jsonrpc.cgi",
"type": "GET",
success: function(response) {
if (response.error) {
console.error(response.error.message);
} else {
console.log(response.result);
var r = response.result.bugs[0];
// do stuff here
}
},
error: function() {
console.error(arguments);
}
});
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment