Skip to content
Advertisement

Tag: ajax

Fail to load .php files with ajax in Javascript

Instead of using jQuery here I am trying to use Javascript to load several .php files to display data from the database according to the user’s input. Below is an example of how my functions are like (and most of which are similar): and below is a screenshot of the index in the server. “sample.html” is the page for displaying

data-id always returns the same value

I am calling an api using ajax which returns me a list of available coaches in a particular area. I am then displaying each coach and his details(firstname, picture, email etc) in a div using foreach loop. Each div has a contact button which should send an email to the coach so in order to get the coach email, I

Unknown problem with (probably) POST method

This task is quite simple but I just can’t seem to get it to work. What the outcome should be is explained in the picture below. I guess that there is some kind of a problem with POST in php, but I’m not sure. Do you see what’s the problem that’s causing this not to work? Problem: No results are

how to disable button if ajax gives error message

I would like to know how I could disable and enable a button according to the message that ajax returns. This is the button that should be disabled in case ajax says that the endpoint is not valid and in case it is correct it should be enabled. PHP CODE Answer If you modify the PHP to return a more

How to decode JSON when using PHP multi_curl

I’m trying to access data on the internet via an AJAX and using PHP. I’ve managed to access to data, however, it is JSON encoded. I want to decode the results. PHP File: If you replace ‘json_encode($output)’ with ‘json_decode($output)’ or just ‘$output’ doesn’t work as it returns null with console.log(). JavaScript File: Data Returned is JSON encoded: Desired Data Formatting

what is this request response format?

i’m trying to scrape a website but the thing is that i get this as a response (most likely javascript ? ). I am using request in order to send requests to the website. Is it possible to convert it to a parsable format ? I thought of using jQuery to send request an accept a certain response format.But as

Advertisement