j-FormData
Za pomocą tego elementu można wysłać dane za pośrednictwem metody POST/PUT/DELETE do bieżącego okna lub innego.
- Singleton
Konfiguracja
method {String}jest standardową metodą HTTP (default:POST)target {String}jest standardowym celem (default:_blank)type {String}Podstawowy typ formularza (default form):application/x-www-form-urlencoded)
Metody
component.send(opt)- Metoda formularza
opt.method {String}, standardowyconfig.method - Formularz
opt.target {String}, standardowyconfig.target - Typ formularza
opt.type {String}, standardconfig.target opt.url {String}wymagane adres URLopt.data {Object}wymagane dane formularza w formie{ key1:value, key2:value }
- Metoda formularza
Użyj go z <ui-component name="formdata">Gdy element nie jest jeszcze ładowany, jComponent Pobierz go po pierwszym użyciu z adresu DEF.fallback (Wydaje się Componentator Autor: Peter Širka Źródło: Componentator Zestaw składników, licencja MIT.
<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>