I know this can be done through PHP ... languages.
But,
here is the scenario:
I load html files in specific "div" in "current.html" file by following function:
$("#dv_sample").load("https://sifr.in/sample_page.html",function(){
//do my work here ...
});
This works fine.
I want to use this same function and load "https://sifr.in/sample_page.html" into div, on another (my own)website,
So,
I want to set CORS, only on this "https://sifr.in/sample_page.html" file.
I have to set following header in "sample_page.html" (.html is important)
Access-Control-Allow-Origin: *
How do I set it?
(without PHP or any other language).
I have tried setting below line in sample_page.html:
<meta http-equiv="Access-Control-Allow-Origin" content="*">
But it doesn't work.
Can JavaScript be useful?