Witaj Gościu! ( Zaloguj | Rejestruj )

Forum PHP.pl

> Funkcja zwraca Undefinied
topcio
post 20.04.2023, 05:19:59
Post #1





Grupa: Zarejestrowani
Postów: 140
Pomógł: 0
Dołączył: 14.01.2017

Ostrzeżenie: (0%)
-----


Witam

Prośba o pomoc, co robię nie tak, że funkcja zwraca mi UNDEFINIED

  1.  
  2. document.addEventListener('DOMContentLoaded', (event) => {
  3.  
  4. const equipmentHelmet = document.querySelectorAll('.equipment_helmet');
  5.  
  6. function all() {
  7. $.ajax({
  8. type: "GET",
  9. url: './form/eq_helmet.php',
  10. success: function (response) {
  11. response = JSON.parse(response);
  12. if(response.length) {
  13. console.log(response);
  14. return {
  15. buttons: {
  16. Spam: ({
  17. text: ' ',
  18. backgroundColor: 'transparent',
  19. buttonWithImage: true,
  20. imageFrame: 'url(/images/equipment/EQ_Common.webp)',
  21.  
  22. imageOptURL: 'url(/images/equipment/ACCESSORY_Ambrosial_Cup.webp)',
  23. imageOptSize: 'cover',
  24. imageOptPosition: 'center',
  25. imageOptRepeat: 'no-repeat',
  26.  
  27. imageWidth: '80px',
  28. imageHeight: '80px',
  29.  
  30. action: function(){
  31.  
  32. }
  33. })
  34. }
  35.  
  36. }
  37. }
  38. }
  39. });
  40. }
  41.  
  42. equipmentHelmet.forEach(div => {
  43. div.addEventListener('click', function() {
  44. $.confirm({
  45. content: '',
  46. title: 'Zmień Budynek',
  47. closeIcon: true,
  48. action: console.log(all()),
  49. });
  50. });
  51. });
  52. });


Ten post edytował topcio 20.04.2023, 05:20:21
Go to the top of the page
+Quote Post
 
Start new topic
Odpowiedzi
topcio
post 20.04.2023, 10:53:05
Post #2





Grupa: Zarejestrowani
Postów: 140
Pomógł: 0
Dołączył: 14.01.2017

Ostrzeżenie: (0%)
-----


Pewnie z braku wiedzy wink.gif
Wszystko co robię staram się robić sam, albo znaleźć i dopasować, niestety robię to hobbystycznie więc gdzieniegdzie wiedza jest, a gdzieniegdzie jej nie ma

Ten post edytował topcio 20.04.2023, 11:01:18
Go to the top of the page
+Quote Post

Posty w temacie


Reply to this topicStart new topic
18 Użytkowników czyta ten temat (18 Gości i 0 Anonimowych użytkowników)
0 Zarejestrowanych:

 



RSS Wersja Lo-Fi Aktualny czas: 27.04.2024 - 14:41