htmlcssnewbie
02-01-2008, 11:47 AM
OK, I have a big problem and I can't quite figure out the solution.
Here's the deal: I have a parent window. From the parent window, I call a popup window. Inside this popwindow, I click on a link that excutes a javascript function. Inside this function, it makes an ajax call. Then I close the window. The problem is the ajax call does not finish before the window closes. So, it creates a hanging TCP connection. Clicking the popup again and going through the same process creates another socket connection that hangs. So, that's two connections that are waiting to be terminated but never will be. Now, I open the popup a third time; however, this time, it freezes. The problem is, and I think it affects IE, firefox, and others, you cannot have more than two simultaneous connections open. So, I have to close out of IE (the browser I'm testing) and open it again to close the connections.
Now, the above was an introduction to the real issue at hand, which is the popup window closes before the ajax function finishes processing.
I found a link which explains a possible workaround, but I don't think I'm implementing it correctly.
http://www.captain.at/howto-ajax-parent-opener-window-close-error.php (please take a look at it; it's less than a page long).
Now, I'm using an open-source ajax library called ajason, fyi. Following the instructions at the link, I execute the ajax javascript function on the parent page. The code for the server-side counterpart is located on the popup page, because I was doing all of the ajax calling in the popup page originally. I don't know if i have to transfer the server-side ajax counterpart to the parent page to make this work.
Can someone please help me out?
Thank you.
Here's the deal: I have a parent window. From the parent window, I call a popup window. Inside this popwindow, I click on a link that excutes a javascript function. Inside this function, it makes an ajax call. Then I close the window. The problem is the ajax call does not finish before the window closes. So, it creates a hanging TCP connection. Clicking the popup again and going through the same process creates another socket connection that hangs. So, that's two connections that are waiting to be terminated but never will be. Now, I open the popup a third time; however, this time, it freezes. The problem is, and I think it affects IE, firefox, and others, you cannot have more than two simultaneous connections open. So, I have to close out of IE (the browser I'm testing) and open it again to close the connections.
Now, the above was an introduction to the real issue at hand, which is the popup window closes before the ajax function finishes processing.
I found a link which explains a possible workaround, but I don't think I'm implementing it correctly.
http://www.captain.at/howto-ajax-parent-opener-window-close-error.php (please take a look at it; it's less than a page long).
Now, I'm using an open-source ajax library called ajason, fyi. Following the instructions at the link, I execute the ajax javascript function on the parent page. The code for the server-side counterpart is located on the popup page, because I was doing all of the ajax calling in the popup page originally. I don't know if i have to transfer the server-side ajax counterpart to the parent page to make this work.
Can someone please help me out?
Thank you.