1

Topic: Why AJAX the request is interrupted?

Good afternoon all!
Who helps to solve a problem.
I use prototype.js
From a primary window I open a child window from which, after there is nobody a choice, it is necessary to update contents of some elements of a primary window and a child window to close.
From a child window on  I cause the following code:

window.opener.sendRequest ();
window.close ();

The primary window code:

var myAjax;
function doRequest (sPost) {
myAjax = new Ajax. Updater (
{success: ' result_table ', failure: ' result_table '};
"moderate.php";
{
method: ' post ';
postBody: sPost
});
}
function sendRequest () {
sPost = "bla-bla-bla";
doRequest (sPost);
return false;
}

Thus Ajax. Updater   though doRequest () it is caused normally.
If I transfer child window closing in myAjax.onComplete all works, but, at first, the window is closed not at once that is not pleasant to the customer, and, secondly, in  generally on .
Help, who can!

2

Re: Why AJAX the request is interrupted?

Try in a primary window:

function sendRequest () {
window.setTimeout (function () {self.doRequest ("bla-bla-bla");}, 100);
}

3

Re: Why AJAX the request is interrupted?

About! Thanks huge!
Works perfectly.