0

I am using iframe in my website. There is a <script src='/demo.js'></script> reference inside the html in the iframe. In the server side, the content of the demo.js is as below:

window.location.replace('https://i3dfjejwog6.cloudfront.net/demo/index.js');

it just redirects the request to a different url. When I load the website, the browser will download the index.js from above redirect url instead of loading it as a javascript file. How can I make the browser to load the file as javascript?

I have checked this post: How do I include a JavaScript file in another JavaScript file? but it doesn't work because I don't have permission to update demo.js file so I am looking for a redirect solution.

Joey Yi Zhao
  • 37,514
  • 71
  • 268
  • 523

0 Answers0