---
title: Capturing cross-domain script errors
description: Capture errors from cross-domain scripts in JavaScript applications with proper CORS configuration.
url: https://docs.honeybadger.io/lib/javascript/errors/capturing-cross-domain-script-errors/
---

Honeybadger ignores cross-domain script errors by default because they contain no useful information. You can fix this by loading your scripts with [CORS](https://developer.mozilla.org/en-US/docs/Web/HTTP/CORS).

To enable CORS on your cross-domain scripts, add the CORS header to your web-server:

```plaintext
Access-Control-Allow-Origin: *
```

Then add the [`crossorigin`](https://developer.mozilla.org/en-US/docs/Web/HTML/CORS_settings_attributes) attribute to your script tag:

```plaintext
<script src="//cdn.example.com/application.js" crossorigin>
```

For server-specific instructions, check out [enable-cors.org](https://enable-cors.org/server.html).

---

## Try Honeybadger for FREE

Intelligent logging, error tracking, and Just Enough APM™ in one dev-friendly platform. Find and fix problems before users notice.

[Start free trial](https://app.honeybadger.io/users/sign_up)

[See plans and pricing](https://www.honeybadger.io/plans/)
