my folder structure looks like this :
D:/examplefolder/index.html
and
D:/examplefolder/js1.js
code for index.html is:
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="UTF-8">
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<title>Document</title>
</head>
<body>
<script type="module" src="./js1.js"></script>
</body>
</html>
code for js1.js:
console.log('hello');
I am new to js, but from whatever i know, CORS error is generated if I try to access resource from different origin. So, why am i getting cors error when opening index.js using double click although they seem to have same origin??
Am I being wrong when i say they are at same origin?
I found similar question on stack overflow, but I was unable to understand it. Please Help ;(