You can't use JavaScript if the app is in the background, as it is halted, hence you need to send to a server, then pull from the server from your JavaScript when the app is resumed (via the foreground event). What are the dependencies that you report as 404, out of curiosity?