Circumventing Chrome Access-control-allow-origin on the local file system?

前端 未结 3 1555
夕颜
夕颜 2020-12-01 07:38

I\'ve read the other same origin policy topics here on SO, but I haven\'t seen any solutions related to the local file system.

I have a web app (In a loose sense of

3条回答
  •  时光取名叫无心
    2020-12-01 08:16

    Interesting, but how can I use the same technique to load in a whole HTML file? Similar problem to yours -- I have hundreds of HTML files which I want to include within a web page, depending on what the user wants to see. It seems I can use this technique to load in a whole HTML page, something like:

    script.id = 'uploadScript';
    script.type = 'text/html';
    script.src = url; 
    script.onload = refresh_page; 
    head.appendChild(script);  
    

    ie, tell it load in HTML. I can see from the console that it is loading it into the page, and I get a message 'Resource interpreted as script but transferred with MIME type text/html'. But I cannot figure out any way to get at the HTML loaded in and held within the script

提交回复
热议问题