function qs(key) { key = key.replace(/[*+?^$.\[\]{}()|\\\/]/g, "\\$&"); // escape RegEx meta chars var match = location.search.match(new RegExp("[?&]"+key+"=([^&]+)(&|$)")); return match && decodeURIComponent(match[1].replace(/\+/g, " ")); } $(document).ready(function(){ // setup a function to grab the nodeStats function getNodeStats() { var uuid = qs("uuid"); var statsTableBody = ""; $.getJSON("/nodes/" + uuid + ".json", function(json){ // update the table header with the right node type $('#stats-lead h3').html(json.node_type + " stats (" + uuid + ")"); delete json.node_type; $.each(json, function(key, value) { statsTableBody += "