I have a custom plugin for FireFox which writes a file in the users filesystem at a specified location. The plugin is invoked via appending a hidden tag to the body of the document with the plugin commands as attributes in the tag (Save, Remove etc) This works great however, I want to know when the entire file has completed writing. I can see the GET request in the browser debugger network tab and can see when it finishes writing the file. I want to add an event listener to that GET request and fire a call back when complete on Status 200 OK. I have tried all kinds of methods like adding an ID to the embed tag and using jQuery $("embed").load(function(){ callback }); But I think I am missing a step or something?
Is there a way to listen for a GET request fired when an tag has been appended to the body of a document? I would love to find a pure javascript solution. I do have jQuery available if its easier. or maybe I am missing something pretty easy to do?
ok so to be clear:
$("body")append("<embed type='application/x-abc-fileactions' hidden='true' command='save' filename='c:\fileactions\somefile.txt'>");
this fires off a GET request once I embed it and downloads somefile.txt file from a vault server.
I would like to have a callback after the entire file somefile.txt can completed writing.
Let me know if that clears it up?