15,075
edits
mNo edit summary |
|||
| (6 intermediate revisions by the same user not shown) | |||
| Line 16: | Line 16: | ||
#* iframe: Available<ref>[https://stackoverflow.com/questions/164085/javascript-callback-when-iframe-is-finished-loading events - Javascript callback when IFRAME is finished loading? - Stack Overflow]</ref> ''not verified'' | #* iframe: Available<ref>[https://stackoverflow.com/questions/164085/javascript-callback-when-iframe-is-finished-loading events - Javascript callback when IFRAME is finished loading? - Stack Overflow]</ref> ''not verified'' | ||
#* ajax: Available<ref>[http://api.jquery.com/jquery.ajax/ jQuery.ajax() | jQuery API Documentation]</ref> | #* ajax: Available<ref>[http://api.jquery.com/jquery.ajax/ jQuery.ajax() | jQuery API Documentation]</ref> | ||
== file included was locate on different server == | |||
<table border="1"> | |||
<tr> | |||
<th>remote website -> origin website</th> | |||
<th>embed remote image file</th> | |||
<th>execute javascript file</th> | |||
<th>ajax call remote json file</th> | |||
</tr> | |||
<tr> | |||
<td>remote: url start with http not https -> origin: localhost</td> | |||
<td>ok</td> | |||
<td>ok</td> | |||
<td>Error: "... has been blocked by CORS policy: No 'Access-Control-Allow-Origin' header is present on the requested resource"</td> | |||
</tr> | |||
<tr> | |||
<td>remote: url start with https -> origin: localhost</td> | |||
<td>ok</td> | |||
<td>ok</td> | |||
<td>Error: "... has been blocked by CORS policy: No 'Access-Control-Allow-Origin' header is present on the requested resource"</td> | |||
</tr> | |||
<tr> | |||
<td>remote: url start with http -> origin: https</td> | |||
<td>ok</td> | |||
<td>Error: "Mixed Content: The page at 'https://website' was loaded over HTTPS, but requested an insecure script 'http://remote_website/file.js'. This request has been blocked; the content must be served over HTTPS. | |||
"</td> | |||
<td>Error: "... has been blocked by CORS policy: No 'Access-Control-Allow-Origin' header is present on the requested resource"</td> | |||
</tr> | |||
<tr> | |||
<td>remote: url start with https -> origin: http</td> | |||
<td>ok</td> | |||
<td>ok</td> | |||
<td>Error: "... has been blocked by CORS policy: No 'Access-Control-Allow-Origin' header is present on the requested resource"</td> | |||
</tr> | |||
</table> | |||
error message | |||
<pre> | |||
Access to XMLHttpRequest at 'http://remote.website/test.json' from origin 'http://local.website' has been blocked by CORS policy: No 'Access-Control-Allow-Origin' header is present on the requested resource. | |||
jquery-3.3.1.min.js:2 Cross-Origin Read Blocking (CORB) blocked cross-origin response http://remote.website/test.json with MIME type application/json. See https://www.chromestatus.com/feature/5629709824032768 for more details. | |||
Mixed Content: The page at 'https://local.website/test.php' was loaded over HTTPS, but requested an insecure script 'http://remote.website/test.js'. This request has been blocked; the content must be served over HTTPS. | |||
</pre> | |||
= client-side approach = | = client-side approach = | ||
| Line 73: | Line 119: | ||
* Boutell.Com, Inc. (2007). [http://www.boutell.com/newfaq/creating/include.html How Do I Include One HTML File in Another?] / Jennifer Kyrnin (n.d.). [http://webdesign.about.com/od/ssi/a/aa052002a.htm] | * Boutell.Com, Inc. (2007). [http://www.boutell.com/newfaq/creating/include.html How Do I Include One HTML File in Another?] / Jennifer Kyrnin (n.d.). [http://webdesign.about.com/od/ssi/a/aa052002a.htm] | ||
* [http://stackoverflow.com/questions/676394/how-to-include-an-html-page-into-an-html-page How to include an html page into an html page] | * [http://stackoverflow.com/questions/676394/how-to-include-an-html-page-into-an-html-page How to include an html page into an html page] | ||
* [https://developer.mozilla.org/zh-TW/docs/Web/HTTP/CORS 跨來源資源共用(CORS) | MDN] | |||
* [https://stackoverflow.com/questions/7564832/how-to-bypass-access-control-allow-origin php - how to bypass Access-Control-Allow-Origin? - Stack Overflow] | |||
References | |||
<references /> | |||
[[Category:Web_Dev]] [[Category:Wiki]] | [[Category:Programming]] [[Category:Web_Dev]] [[Category:Wiki]] | ||