This is my code:
inserisciMarker();
function scorriAllaLista(param) {
alert(param);
}
function inserisciMarker() {
markerClick = function () {
$('#example').attr("onclick", "scorriAllaLista('hello'); return false;");
};
markerClick();
}
clicking on link, Uncaught ReferenceError: scorriAllaLista is not defined
Why? How can I fix it?
window.scorriAllaLista = scorriAllaListaWhy are you setting an onclick attribute with javascript rather than binding an event?attr()to add event handlers!