-1

Link works when it's set in HTML but not from JavaScript. The functions will change to another page. The JavaScript Link is shown properly with image and name but by clicking on the link I get that specific error saying "Syntax Error". Tried different inverted commas but it won't work, I'm quite clueless at the moment.

$("#readerList").append("<li><a href='#' onclick='getSpecificReader(" + val.name + ")' ><img src='" + val.image_url + "'>" + val.name + "</a></li>"); 
             
<li><a href="#" onclick="getReaderByType('Gate Reader')">Gate Readers<span class="ui-li-count">25</span></a></li>
Lyn
  • 125
  • 2
  • 11