I have this code:
<script src="https://ajax.googleapis.com/ajax/libs/jquery/1.12.4/jquery.min.js"></script>
var newPoint = "<div class='item-point' data-top='" + cY + "' data-left='" + cX + "' id='point" + random + "'>" +
"<div>" +
"<a onclick='test(1);' target='_blank' href='" + url + "' class='toggle tooltips' title='" + description + "' data-placement='top' data-html='true' rel='tooltip'><span class='pointFormat'>" + pointCount + "</span></a>" +
"</div>" +
"</div>";
$(".scalize").append(newPoint);
<div class="scalize"></div>
function test(variable) {
alert(variable);
}
and it's not working. I have error: ReferenceError: Can't find variable: variable.
I have error when I click on link (a href)
How to repair it?