ExampleTool.php.example.js 427 B

123456789101112131415
  1. console.log('URL_TEST_AJAX_ACTION:', URL_TEST_AJAX_ACTION)
  2. if (!URL_TEST_AJAX_ACTION) {
  3. throw "Brak zmiennej URL_TEST_AJAX_ACTION"
  4. }
  5. global.fetch(URL_TEST_AJAX_ACTION, { // @doc https://github.com/github/fetch
  6. credentials: 'same-origin', // or 'include' for CORS
  7. }).then(function (response) {
  8. return response.json()
  9. }).then(function (data) {
  10. console.log('data', data)
  11. }).catch(function (e) {
  12. console.warn('Error', e)
  13. })