I have an "a href" tag that calls a function when clicked, but it's not working and I'm getting this error:
Uncaught ReferenceError: Gonder is not defined index.php:10
onclick
Here is the JavaScript code :
<script type="text/javascript">
$(document).ready(function(){
function Gonder(nereden, nereye) {
$.ajax({
type: "POST",
url: "/ara.php",
data: '{ "nereden":"' + nereden + '", "nereye":"' + nereye + '" }',
contentType: 'application/json; charset=utf-8',
success: function (result) {
$("#sonuc").html(result.d);
},
error: function (result) {
$("#sonuc").html(result.d);
}
});
}
});
</script>
And here is the HTML code :
<a href="javascript:void(0)" onclick="Gonder(100, 101);" title="">
click</a>
This setup is not functioning as expected...