There was another question from a while ago along similar lines. And the basic answer that I stumbled upon was that, by the very nature of how some browsers work, it's not at all possible. I'm not sure if iPhone's browser is the same, but Chrome seems to download all the scripts before it starts executing them.
The example I made for that other question was something along these lines:
<script src="first.js"></script>
<script src="second.js"></script>
The second.js was just a simple alert, to see if it loaded or not.
The first.js script had a synchronous AJAX request that told PHP to delete second.js. The reasoning was that PHP could delete the file, and then the browser would request it, but get a 404 error.
But (on Chrome, anyway) the second script was still executed. Even when the first script deleted the file from the server, it still executed.
Not possible.