$("#withdrawn").text(withdraw.join()); $("#asize").text(withdraw.length); $.getJSON('http://www.patentsview.org/api/patents/query?q=%7B%22patent_number%22%3A%5B' + withdraw.join() + '%5D%7D&f=%5B%22patent_number%22%2C%20%22patent_date%22%2C%20%22patent_title%22%2C%20%22uspc_subclass_id%22%2C%20%22cpc_subgroup_id%22%5D&s=%5B%7B%22patent_number%22%3A%22asc%22%7D%5D&o=%7B%22per_page%22%3A' + withdraw.length + '%7D', function(result){ var tr; var data= result.patents; for (var i = 0; i < data.length; i++) { tr = $(''); tr.append('' + data[i].patent_number + ""); tr.append("" + data[i].patent_date + ""); tr.append("" + data[i].patent_title + ""); var uspcs = data[i].uspcs; var uspcs_str = ""; var sep = ''; for(var j=0;j" + uspcs_str + ""); var cpcs = data[i].cpcs; var cpc_str = ""; sep = ''; for(var j=0;j" + cpc_str + ""); $('#table1').append(tr); } $('.waitn4data').hide(); $("#num").text(data.length); $("#results").text(result.total_patent_count); var json = syntaxHighlight(JSON.stringify(result,undefined,4)); var html = ""; html+= "
"+json+"


"; $("#details").html(html); } ); function syntaxHighlight(json) { if (typeof json != 'string') { json = JSON.stringify(json, undefined, 2); } json = json.replace(/&/g, '&').replace(//g, '>'); return json.replace(/("(\\u[a-zA-Z0-9]{4}|\\[^u]|[^\\"])*"(\s*:)?|\b(true|false|null)\b|-?\d+(?:\.\d*)?(?:[eE][+\-]?\d+)?)/g, function (match) { var cls = 'number'; if (/^"/.test(match)) { if (/:$/.test(match)) { cls = 'key'; } else { cls = 'string'; } } else if (/true|false/.test(match)) { cls = 'boolean'; } else if (/null/.test(match)) { cls = 'null'; } return '' + match + ''; }); }