Ext JS : iframe load event for downloaded file from Chrome

  1. justin.john
    justin.john
    I am having a problem with onLoad event of an iframe on Google Chrome.
    I created an iframe and set value for its "src" attribute to get a file from server.
    While server is processing, a loading box is displayed until client gets the returned file.
    I tried to use the onLoad event of iframe to detect when client get the file to turn off that waiting box, but on Google Chrome that event handler does not work.
    With Firefox, when client gets a file, a "Save to" popup will be displayed automatically and event "load" will be fired, but this is not happen on Chrome.
    With IE, when client gets a file, event "readystatechange" will be fired, but this is not happen on Chrome.

    main.loading.show();
    var body = Ext.getBody(), frame;
    var frameComp = {
    tag : 'iframe',
    cls : 'x-hidden',
    id : 'downloaderframe',
    name : 'downloaderframe',
    src : url,
    onload : 'main.loading.hide();'
    };
    frame = body.createChild(frameComp);
    frame.on('readystatechange', function () {
    alert(1);
    main.loading.hide();
    });
    frame.on('load', function () {
    alert(2);
    main.loading.hide();
    });
    Any help is must appreciated. Thank you.
Results 1 to 1 of 1