you can escape the end of a line with a backslash character \ , for example:
$.each(data.result, function(){ $("ul").append("<li>Name: " + this['name'] + "</li> \ <li>Age: " + this['age'] + "</li> \ <li>Company: "+this['company']+"</li> \ <br />"); });
This is because Javascript automatically inserts half-columns sometime at the end of the line. And in this case, the string was not close. Another solution is to close each line in each line and use + to concatenate them.
$.each(data.result, function(){ $("ul").append("<li>Name: " + this['name'] + "</li>" + "<li>Age: " + this['age'] + "</li>" + "<li>Company: "+this['company']+"</li>" + "<br />"); });
(Unbound, but you are <br/> not allowed inside the <ul> element)
source share