this is my javascript part:
<script>
$(document).ready(function(){
$(".annotator-save").click(function () {
var value=$('#jid').text();
$.ajax({ url: '/response/insert',
data: {val: value}, i want this to directly go to the function
insert.
i.e the text has to be displayed.
type: 'post',
success: function(output) {
alert(output);
}
});
</script>
what is wrong with my ajax code?
and my php function is-
<?php
function insert()
{
echo $_POST_['val'];
return $_POST_['val'];
}
?>
it is entering the php file but not the insert function