Add fail-safe mechanism for JavaScript, loading from local files when CDN fails