Sorry, you're right. the code posted is incorrect. the right one is:
function otherFunc(o){
[.....]
};
function ajaxCall(url, callbackResponse_1, p) {
try{
new Ajax.Request(url, {
method: 'get',
asynchronous: true,
onSuccess: function(transport) {
otherFunc(p);
callbackResponse_1();
}
});
} catch (exception) {
alert(exception.inspect());
}
}
..anyway onSucces never got reached because Ajax.request simply die
after onCreate().To be more precise I had a JSP page including three
<script> tag:
<script>prototype.js</script>
<script>ajaxCall.js</script>, which contains the ajaxCall() and the
otherFunc() functions above.
<script>{inline_script}</script>, which contains a function "search()"
that calls ajaxCall(url,callbackResponse_1,p) and, of course, function
callbackResponse_1() itself.
After that there's an anchor in the page's form with
"javascript:search();" in its onClick attribute.
Please consider that I didn't write this page by myself (..I think,
for other thousands good reasons, that it is really a messy JSP!!!)
I'm just bugfixing it.
The fact is that the page won't work if simply import prototype.js on
IE7 (7.0.5730.13), but it works on FF (3.6.12) and IE 8. The only ways
that I found out to get it work are:
- moving "function() {return new XMLHttpRequest()" and the end of the
Try.these statement in prototype code (it works in ANY browser i
tried).
- disable "native XMLHttpRequest support" from IE7 advanced options
(but as you easily understand I can't force users to disable a browser
option to use my page.. :-| ).
Any other suggestion?
On 2 Dic, 00:05, "T.J. Crowder" <
t...@crowdersoftware.com> wrote:
> Hi,
>
> Your code, as quoted, assumes that the symbols `callbackResponse_1`
> and `callbackResponse_2` are defined by a scope enclosing your
[.....]