K
K
kn18sv2021-03-09 18:50:04
JavaScript
kn18sv, 2021-03-09 18:50:04

What is the correct way to connect .htm files to another .html file using angularJS?

Help please. I'm trying to connect this file

<!DOCTYPE html>
<html>
<script src="https://ajax.googleapis.com/ajax/libs/angularjs/1.6.9/angular.min.js"></script>
<head>
  <title></title>
</head>
<body>
  <table>
    <tr ng-repeat="x in names">
      <td>{{ x.name }}</td>
      <td>{{ x.country }}</td>
    </tr>
  </table>
</body>
</html>

directly to this file
<!DOCTYPE html>
<html>
<script src="https://ajax.googleapis.com/ajax/libs/angularjs/1.6.9/angular.min.js"></script>
<head>
  <title></title>
</head>
<body>
  <table>
    <tr ng-repeat="x in names">
      <td>{{ x.name }}</td>
      <td>{{ x.country }}</td>
    </tr>
  </table>
</body>
</html>

gives the following error in the browser console:
example.html#!/:1 Access to XMLHttpRequest at ' file:///C:/Users/*/Desktop/htab/myTable.htm ' from origin 'null' has been blocked by CORS policy: Cross origin requests are only supported for protocol schemes: http, data, chrome, chrome-extension, chrome-untrusted, https.

Answer the question

In order to leave comments, you need to log in

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question