[CLOSED] DirectMethod is not working inside window.onbeforeunload for Firefox

  1. #1

    [CLOSED] DirectMethod is not working inside window.onbeforeunload for Firefox

    Hi:
    I need to execute a DirectMethod when the page starts unload, so i had written a code in javascript as follows:
     window.onbeforeunload = function(e) {
                Ext.net.DirectMethods.RemoveUserCache();
     };
    this code works fine in IE, but in Firefox it throws error as Communication Failure and the "Ext.net.DirectMethods.RemoveUserCache()" function is not getting executed.

    Pls. help me on this.
    Last edited by Daniil; Jul 18, 2011 at 2:49 PM. Reason: [CLOSED]
  2. #2
    Hi,

    It's not a good idea to call a DirectMethod within 'beforeUnload', because a page is being destroyed (and DirectMethods as well).

    Just in IE a page is being destroyed slower than in FF and it "works". But, I think, sometimes it can not work.

    Please investigate the following thread.

    There was a similar problem, but in case with TabPanel and closing iframe tabs.
    http://forums.ext.net/showthread.php?13794
  3. #3
    If request executing during page destroying then the page abort that request and you will see that message

Similar Threads

  1. [CLOSED] Desktop window not working in firefox
    By RCM in forum 1.x Legacy Premium Help
    Replies: 1
    Last Post: Apr 16, 2012, 7:35 AM
  2. Replies: 2
    Last Post: Jun 20, 2011, 4:18 PM
  3. Replies: 3
    Last Post: May 08, 2011, 2:08 AM
  4. Replies: 2
    Last Post: Sep 21, 2010, 11:14 AM
  5. Replies: 0
    Last Post: Apr 15, 2010, 3:15 AM

Posting Permissions