0

What is the proper way to keep a local backup of a remote JavaScript file, so that we can reference the external file usually but fall back on a local copy if the remote server cannot be reached?

For instance, if I have a section of code that looks like this:

<script src="https://foo.bar.js" type="text/javascript" charset="utf-8"></script>

is there a way to add a fallback to the local file "/scripts/foo.bar.local.js" on our server, which is only used if the above line fails to load?

Jeff
  • 2,707
  • 3
  • 36
  • 65

0 Answers0