I'm getting syntax error when using this code:
$('#column1').append('<span class="link_style"><a href="#" onClick="show_text(' + new_cities[i][j].content + ')"></a></span>');
When javascript executes I'm getting this code generated:
<a href="#" onclick="show_text(<p>description</p>)">Moscow</a>
and this would be the function which is producing error:
function show_text(text)
{
alert(text);
}
new_cities[i][j].content has this value "<p>description</p>" so basically my data is represented as string so there is definitely some problem in the quotes....