ForgeKomponenty
pl

Komponenty

j-FormData

jComponent 20 · jcomponent@20 component Przykład załadowany z jComponent 20

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}, standardowy config.method
    • Formularz opt.target {String}, standardowy config.target
    • Typ formularza opt.type {String}, standard config.target
    • opt.url {String} wymagane adres URL
    • opt.data {Object} wymagane dane formularza w formie { key1:value, key2:value }

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.

example.html
<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>