Skip to content

chenyong/cors-error

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

1 Commit
 
 
 
 
 
 
 
 

Repository files navigation

Sometimes we get Script error. lineno: 0, colno: 0 from cross domain scripts.

Details described at:

The fix:

crossorigin="anonymous"

Nginx 配置:

server {
  listen 80;
  server_name cors-error-1 cors-error-2 cors-error-3;
  add_header 'Access-Control-Allow-Origin' '*';
  root /Users/chen/work/cors-error/;
  autoindex on;
  index index.html;

  location ~ /\.git {
    deny all;
  }
}

In this repo, I just tried the demo. Remove crossorigin="anonymous" in HTML file to reproduce the problem.

And the conlusion: crossorigin="anonymous" to the script that may throw errors.

About

No description, website, or topics provided.

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published