To the best of my knowledge, the following is roughly how Apple seems to see it:
- If you are downloading content that has some JavaScript code along with it (say, to support event binding, etc.), there is no problem. It's part of the content (even if code).
- If you are downloading code that changes the core functionality of your app, Apple may take issue. (Just because they don't always do so doesn't mean a particular reviewer might not take issue with you for doing so.)
The extreme example, of course, would be to develop a Calculator app, and then via a code update (routed around Apple's review process) change the app to a Minecraft clone. Obvious problems, there, right? There are plenty of avenues here for abuse (intentional or not).
To be honest, although your update probably wouldn't change the behavior of your app completely, it is risky in order to perform these kinds of updates. Given that Apple can't watch every app with an eagle eye, you'd probably squeak through. But is it worth the chance that you won't? Only you can answer that.