I'm trying to display some information from a json object. My getJson function doesn't return anything.
I think the problem is that i don't target the right value.
My code:
<div id="content" class="clearfix row">
<div class="col-md-6">
<p>Please enter your searchterm:</p>
<input id="myinput" type="text">
</div>
<div class="col-md-6" id="result">
</div>
jQuery(document).ready(function() {
jQuery.getJSON("http://ghost-app.com/api/search?searchterm=pro_wheely",function(data){
jQuery("#result").prepend('<h3>'+data.players.results[0].username+'</h3>');
});
});
I can view the json file just fine in my browser. JSON link
As far as i can tell everything looks right. Any suggestions?