removes GreaseMonkey's JQuery, uses pure json instead of JSON-P

This commit is contained in:
Jason Salaz 2014-12-30 08:35:11 -08:00
parent fca73e80e5
commit 8108a1449b

View file

@ -45,14 +45,9 @@ $(document).ready(function(){
var discogsReleaseId = window.location.href.match( /discogs\.com\/(.*\/?)release\/(\d+)$/)[2];
var discogsWsUrl = 'http://api.discogs.com/releases/' + discogsReleaseId;
// Swith JQuery to MB's one, and save GreaseMonkey one
var GM_JQuery = $;
$ = unsafeWindow.$;
$.ajax({
url: discogsWsUrl,
dataType: 'jsonp',
headers: { 'Accept-Encoding': 'gzip', 'User-Agent': 'MBDiscosgImporter/0.1 +http://userscripts.org/scripts/show/36376' },
dataType: 'json',
crossDomain: true,
success: function (data, textStatus, jqXHR) {
//mylog(data);
@ -65,9 +60,6 @@ $(document).ready(function(){
}
});
// Back to GreaseMonkey's JQuery
$ = GM_JQuery;
}
});
@ -245,7 +237,7 @@ function insertLink(release) {
// Analyze Discogs data and return a release object
function parseDiscogsRelease(data) {
var discogsRelease = data.data;
var discogsRelease = data;
var release = new Object();
release.discs = [];