Looking to download a series of files from a remote server, asynchronously, with callbacks
Basically, there is a script on my local network that generates a file. I want to be able to make multiple calls to this script at the same time with different variables and present notification to the user when each particular file is ready. I've tried doing it in Javascript, jQuery and PHP, but not having much luck.
I can't seem to get it to work asynchronously through PHP with a callback, and I can't seem to get it to actually download through Jav开发者_如何学JAVAascript or jQuery.
I've tried $.get('script_url')
and $('#someelement').load('script_url')
for jQuery.
I've also tried using http://github.com/coolaj86/jquery-cors and referencing http://developer.mozilla.org/en/http_access_control to no avail.
When script_url is a javascript var, this must work:
$.get(script_url, function(data){ alert 'callback' + data});
The function ist your callback.
精彩评论