jQuery - Parsing JSON file based on mouse click -


this more of theory question rather specific programming problem.

what i'm trying create world of tanks player "search engine" following steps:

  1. enter username of player
  2. parse json object of players similar names , append page
  3. based on name user clicks, clear page , populate json object specific player.

i can generate url returns json file of player, i'm having trouble figuring out way render information page.

here's jsfiddle of code.

this function creates list of matching players , turns name link json file.

$.getjson(searchurl, function(data){         $.each(data, function(key, value){             if(typeof value === 'object'){                 for(var i=0; < data.count; i++){                     var fullplayerurl = "<p class='entry'>" + "<a>" + key +                         "nickname - " + value + "</a>" + "</p>";                     $('#results').append(fullplayerurl);                 }             }         }); }); //end getjson 

my question is, best way generate player's data based on name user clicks (instead of following link json file)?

thanks!


Comments

Popular posts from this blog

python - Subclassed QStyledItemDelegate ignores Stylesheet -

java - HttpClient 3.1 Connection pooling vs HttpClient 4.3.2 -

SQL: Divide the sum of values in one table with the count of rows in another -