There are many reasons to add jQuery to a project. BUT. Please don't add jQuery just to get some json data. Javascript is perfectly capable of handling this one on its own, thank you:
// simple cross-browser ajax helper var ajaxGet = function (url, callback) { var callback = (typeof callback == 'function' ? callback : false), xhr = null; try { xhr = new XMLHttpRequest(); } catch (e) { try { xhr = new ActiveXObject("Msxml2.XMLHTTP"); } catch (e) { xhr = new ActiveXObject("Microsoft.XMLHTTP"); } } if (!xhr) return null; xhr.open("GET", url,true); xhr.onreadystatechange=function() { if (xhr.readyState==4 && callback) { callback(xhr.responseText) } } xhr.send(null); return xhr; } // example usage, grab the json data, loop it and log red_world_id to console ajaxGet( 'https://api.guildwars2.com/v1/wvw/matches.json', function (response) { response = JSON.parse(response); if (!response) return; var i, list = response.wvw_matches; for (i in list) { console.log(list[i].red_world_id); // outputs an id } });
Try it here: http://jsfiddle.net/7WrmL/
So basically, for your specific usage, instead of simply logging the ID to console, you can check each object's id properties against the desired matching id and, for example, return i for the index of the match (not sure I understand exactly what you're after there).
And keep in mind: use jQuery when you need it, not for everything and anything.
Documentation
Access-Control-Allow-Origin:*header, so CORS works fine.