(Unknown): Script Error in JavaScript

When Script Error Occurs In A JavaScript Code?

I am facing an Script Error In JavaScript, What Should I Do?

1. Set up Cross-Origin HTTP header

Access-Control-Allow-Origin: *

There is different method to set his to * in different environments.

Header add Access-Control-Allow-Origin "*"
location ~ ^/assets/ {
add_header Access-Control-Allow-Origin *;
}
rspadd Access-Control-Allow-Origin:\ *

2. Set crossorigin=”anonymous”

<script src="http://another-domain.com/app.js" crossorigin="anonymous"></script>

--

--

--

Deeksha Agarwal is in Product Growth at LambdaTest and is also a passionate tech blogger and product evangelist.

Love podcasts or audiobooks? Learn on the go with our new app.

Recommended from Medium

javascript core concepts

JavaScript for Intermediate

NodeJs internals: V8 & garbage collector

Replicating The GitHub GraphQL API With Neo4j

Advantages of using React.js over other JS UI frameworks

Routing in Vue with Vue Router

2020 Complete Setup for Storybook, Nextjs, Typescript, SCSS and Jest

Your account has been disabled [AWS EC2 Windows][SOLVED]

Get the Medium app

A button that says 'Download on the App Store', and if clicked it will lead you to the iOS App store
A button that says 'Get it on, Google Play', and if clicked it will lead you to the Google Play store
Deeksha Agarwal

Deeksha Agarwal

Deeksha Agarwal is in Product Growth at LambdaTest and is also a passionate tech blogger and product evangelist.

More from Medium

REST API & Koa JS

JavaScript, Git & MongoDB

Java Script callbacks and promises