Try creating an iframe and using the file name as the src. This allows
you to listen to the onload event on the iframe too. this is useful if
your trying to initiate a large server-generated file download, which
might take some time, and you want to show a loader image.

something like below might work.

var dwnldCtr = 0;
function getCurrentView(){
        dwnldCtr++;
        $('linkId').addClassName('loading');

        var src = '/path/to/your/file.ext';
        var frame = '<iframe id=\"download_'+dwnldCtr+'\" src=\"'+src+'\"
style=\"visibility:hidden\"></iframe>';
        $('iframeCont').insert(frame);
        Event.observe('download_'+dwnldCtr, 'load', function(){ $
('linkId').removeClassName('loading'); });
}

-- 
You received this message because you are subscribed to the Google Groups 
"Prototype & script.aculo.us" group.
To post to this group, send email to prototype-scriptacul...@googlegroups.com.
To unsubscribe from this group, send email to 
prototype-scriptaculous+unsubscr...@googlegroups.com.
For more options, visit this group at 
http://groups.google.com/group/prototype-scriptaculous?hl=en.

Reply via email to