Cant make an AJAX call in PHPDesktop

204 views
Skip to first unread message

Daniel Morales

unread,
Oct 21, 2022, 7:29:34 AM10/21/22
to PHP Desktop
Im trying to make a call, it worked perfectly on local and on server, but when I did it when phpDesktop it fails, I've been reading a lot of comments but I dont know where it the error, here are some photos from the errors
errorAjaxCMD.png
errorAjaxConsole.png

Daniel Morales

unread,
Oct 21, 2022, 7:32:00 AM10/21/22
to PHP Desktop
Its an Ajax call to some data Table

Daniel Morales

unread,
Oct 21, 2022, 7:37:47 AM10/21/22
to PHP Desktop
ConsoleAjaxErr.png

El viernes, 21 de octubre de 2022 a las 13:29:34 UTC+2, Daniel Morales escribió:

Daniel Morales

unread,
Oct 24, 2022, 5:30:06 AM10/24/22
to PHP Desktop
ANSWER: In my particular case it was various things, first, set url to /directory/xxx.php or whatever your route is, not your full route and modify your SQL querys, some may me wrong

Wampamba Nooh

unread,
Jul 17, 2023, 6:02:22 AM7/17/23
to PHP Desktop
               try this $.post('{{ route('route.name') }}', {
                    '_token': $('meta[name=csrf-token]').attr('content'),
                    data: id,
                }, function(data) {
console.log(data)
})

for Laravel users modify for PHP OR
          $.get('{{ route('route.name') }}', function(data) {
                // Extract the options from the AJAX response
                var options = data.programs.map(function(item) {
                    console.log(item)
                });
Reply all
Reply to author
Forward
0 new messages