My chrome console gives this error:
Uncaught SyntaxError: Unexpected token } server.js:11
Here's the code:
$(function(){
var servers = "http://site-with-json.com/example"
$.getJSON(servers, function (serverData) {
$.each(serverData.serverList, function() {
$.each(this, function(k, v) {
if (k == "serverName")
{
$( "#browser" ).append( '<div class="server">'+v'</div>' )
}
});
});
});
});
Where the json looks like this:
{
"serverList": [
{
"serverName": "Server 1",
"online": true
},
{
"serverName": "Server 2",
"online": false
}
]
}
Any idea what the error could be? Thanks.