> ## Documentation Index
> Fetch the complete documentation index at: https://docs.symmetry.com/llms.txt
> Use this file to discover all available pages before exploring further.

# Load widget defaults from a URL

> Host a JSON file of widget default values and styling and point the widget at it via JSONP.

Instead of embedding configuration in every script tag, host it in one file and point the widget at it. The widget fetches the file on load via AJAX using **JSONP** (a `jsonCallback` wrapper), so you can update default values and styling in one place.

## Point the widget at a URL

Pass a `url` inside `data-defaults`:

```html theme={null}
<script async src="https://calculators.symmetry.com/widget/js/salary.js?key=yourKey"
    data-defaults='{"url":"https://example.com/cbs/config.json"}'></script>
```

## Host the file as JSONP

Wrap the object in `jsonCallback(...)`. Put field values under a `model` key; `style` sits at the top level:

```javascript theme={null}
jsonCallback({
  "model": {
    "grossPay": 2500,
    "payFrequency": "biweekly"
  },
  "style": { "body": { "background-color": "#2f4f4f" }, "labels": { "color": "#fff" } }
});
```

This is the easiest way to set richer defaults such as multiple deductions.

Help text can't be loaded this way. The URL file is read for field values (`model`) and `style` only. Set help text [inline](/cbs/widgets/customize-helptext).

<Info>
  The widget still loads if the URL is unreachable or the JSON is malformed. It silently falls back to defaults rather than showing an error. Test your file before relying on it.
</Info>

For the full attribute list, see [Configuration methods](/cbs/widgets/configuration-methods). To manage defaults without hosting a file, see [Manage widgets from the admin console](/cbs/widgets/admin-console).
