Skip to content

Instantly share code, notes, and snippets.

View Nederby's full-sized avatar

Jakob Nederby Nielsen Nederby

View GitHub Profile
<link rel="stylesheet" href="https://toolkit.dixa.io/cards/v1/style.css" />
<link
rel="stylesheet"
href="https://unpkg.com/purecss@1.0.1/build/pure-min.css"
integrity="sha384-oAOxQR6DkCoMliIh8yFnu25d7Eq/PHS21PClpwjOTeU2jRSq11vu66rf90/cZr47"
crossorigin="anonymous"
/>
<script>
function validate(t) {
const email = document.getElementById('email');

The JavaScript API provides more control over the widget. You can customize the widget behavior programmatically.

The JavaScript API can be called via window._dixa object after the snippet widget code, e.g. the API can be called with: _dixa(function name{string}, parameter, ... parameter);

It's possible to add as many requests as you need with the following eg.:

window._dixa('api.setLanguage', 'en-US'); // Set the language to English.
@Nederby
Nederby / widget-settings.md
Last active June 28, 2018 12:32 — forked from ktabori/widget-settings.md
Add more supported locals

JavaScript API can be called via window._dixa object after the widget code, e.g. the api can be called with:

_dixa(function name{string}, parameter, ... parameter);

List of the available javascript API settings.:

Set the view of the widget

// view can be "conversation" or "minimized".
<button class="btn btn-block" onClick="window.open(`https://dr.dk?${encodeURIComponent('%&€#!')}`)">Test open window</button>
@Nederby
Nederby / widget-api.md
Last active March 13, 2017 14:23
Dixa widget Javascript API

JavaScript API can be called via window._dixa object after the widget code, e.g. the api can be called with:

_dixa(function name{string}, parameter, ... parameter);

List of the available javascript API settings.:

Set the view of the widget

@Nederby
Nederby / widget-api.md
Last active March 8, 2017 13:38
Dixa widget javascript API

JavaScript API can be called via window._dixa object after the widget code, e.g. the api can be called with:

_dixa(function name{string}, parameter, ... parameter);

List of the available javascript API settings.:

Set the view of the widget