html5 crossorigin attribute

Steps for usage:
1. Added the crossorigin="anonymous" attribute to the html tag
2. The resource server of the src attribute in the html tag also needs to enable cors verification and allow access to the domain name of the referenced page, otherwise the page cannot load the JS
Such as:
  1. Access-Control-Allow-Headers:
    Origin, X-Requested-With, Content-Type, Accept, Range
  2. Access-Control-Allow-Origin:
    *
 
Test Results:
                    add crossorigin attribute | do not add crossorigin attribute
The resource server can load normally when cors is turned on, and accurately capture errors |     can be loaded normally, but errors cannot be accurately captured (only: Script error.)
The resource server cannot be loaded normally without cors enabled |     It can be loaded normally, but the error cannot be accurately captured (only: Script error.)

Guess you like

Origin http://43.154.161.224:23101/article/api/json?id=326291786&siteId=291194637