Skip to main content
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:

Host the file as JSONP

Wrap the object in jsonCallback(...). Put field values under a model key; style sits at the top level:
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.
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.
For the full attribute list, see Configuration methods. To manage defaults without hosting a file, see Manage widgets from the admin console.