I am trying to make a chrome extension that allows to me to take the url of the current tab and pass that to a 3rd party website search. This php returns JSON formatted text. I would then like to format this JSON as a simple html table.
pseudo code:
function getUrl(){ currentUrl = the current tab url }
function search(currentUrl){ get the results from "www.somesite.com/json_search.php?" + currentUrl; assign the JSON formatted text to the array 'results' }
function display(results){ parse the array in 'results' into an HTML table }
this is an example of the JSON that is returned by a search [ {id:44834,title:'title1',size:'32.14 GB',attribute1:1,attribute2:0} , {id:37445,title:'title2',size:'8.91 GB',attribute1:23,attribute2:0} , {id:37143,title:'title3',size:'4.41 GB',attribute1:35,attribute2:0} ]