j-FormData
With this component you can send data via the POST/PUT/DELETE method to the current window or another.
- singleton
Configuration
method {String}a default HTTP method (default:POST)target {String}a default target (default:_blank)type {String}a default form type (default:application/x-www-form-urlencoded)
Methods
component.send(opt)opt.method {String}form method, defaultconfig.methodopt.target {String}form target, defaultconfig.targetopt.type {String}form type, defaultconfig.targetopt.url {String}required URL addressopt.data {Object}required form data in the form{ key1:value, key2:value }
Use it with <ui-component name="formdata">. When the component is not loaded yet, jComponent downloads it on first use from the address in DEF.fallback (the Componentator CDN by default). Author: Peter Širka. Source: the Componentator components repository, MIT license.
<ui-component name="LAZY formdata"></ui-component>
<button>Send data</button>
<script>
$(document).on('click', 'button', function() {
SETTER('formdata/send', { url: 'http://127.0.0.1:8000/api/', data: { name: 'Total.js Platform' }});
});
</script>