Currently I am experiencing a frustrating bug in my code. It seems that I can’t echo an ajax call within php.Below is the code for the call. Any suggestions would be much appreciated Thanks.
echo'
<script>
$.get("fxn.php", { r: ""+result, id:""+'.$id.' } ).
success(function(){
alert("FXN");
});
</script>';
Note:
- Result is a javascript variable.
- $id is a php variable.
- The success function is never called.
Proposed alternate:
Oh, and are you sure that PHP is returning anything? What happens if you use get manually on
fxn.php?