In bottom of my index.php I have a Javascript function between paired <script> tags. I have a click handler that calls the function that makes a Prototype.js Ajax request.
This version does not work (no request is made), although the myFunction itself is called.
function myFunction(fr, fw) {
new Ajax.Request('/ascript', {
method: 'post',
parameters: { a: fr, b: fw },
onSuccess: function(transport) { },
onFailure: function(request) { }
});
}
However when I add the alert("something"); line the ascript php script is called.
function myFunction(fr, fw) {
new Ajax.Request('/ascript', {
method: 'post',
parameters: { a: fr, b: fw },
onSuccess: function(transport) { alert("here"); },
onFailure: function(request) { }
});
}
Might it be some weird whitespace problem? Is there an error in my syntax?