The main problem (assuming your php file is doing what it should) was that in your listener, you defined the data variable twice. By changing it to use different variable names, it is possible to update a javascript variable to contain the data returned by your get request.

If you are looking for more advanced ways of manipulating the data returned in your get function in javascript in much the same way as you would database tables, have a look at http://www.taffydb.com/