javascript ajax button works fine on http://127.0.0.1 but gets error and fails on http://localhost:8888/xxx/public
P粉718165540
P粉718165540 2023-09-21 20:47:40
0
1
624

I am using laravel 10 php 8.10 for work, here the javascript ajax button is working fine on php artisan serve http://127.0.0.1 but getting error on **MAMP PRO** (localhost:8888) ( An error occurred while processing the request) and does not work on the url http://localhost:8888/xxx/public. The following are snippets of html and js:

Need help solving this problem.

**HTML** @if($row->soc_extra==1)  @else  @endif        >    @endforeach **JS** 

Need help solving this problem.

P粉718165540
P粉718165540

reply all (1)
P粉384366923

Is your MAMP Apache port indeed set to port 8888 and not port 80?

I've done this a few times (port 8888 for testing, port 80 for deployment) and kept the Ajax calls targeting localhost instead of localhost:8888 or vice versa.

Alternatively, you may need to explicitly specify the 8888 port in the Ajax call, for example:

url: 'http://localhost:8888/admin/update-socialmedia-status'

Hope this helps?

    Latest Downloads
    More>
    Web Effects
    Website Source Code
    Website Materials
    Front End Template
    About us Disclaimer Sitemap
    php.cn:Public welfare online PHP training,Help PHP learners grow quickly!