Easy AJAX With jQuery

Codecourse · 24K views · 2014 · 19:05

Open on YouTube

Web developmentPython, Ruby & scripting languagestutorialdated

Why Stack Overflow recommends it

Stack Overflow users link it when answering beginners who need to see how JavaScript sends data to a PHP server and displays the response without a page refresh.

Recommended by 2 people across 2 different months, 2015 to 2022.

What it is

A 19-minute screencast from Codecourse that walks through making AJAX requests with jQuery, using a PHP username-availability check as the worked example. It shows the client-side jQuery $.ajax call alongside a simple PHP endpoint that returns JSON.

What people said

Recommends Tenbo · 2017-10 · Stack Overflow · on “Insert PHP functions into Javascript”

What you need is the following: Javascript sends the data to server using AJAX in the client's browser. PHP decodes the request, processes it then responds with the information requested. Javascript receives the response and displays it accordingly. Using Asynchronous Javascript And XML (or AJAX for short) ; you can essentially fetch data from the server dynamically without the client performing a browser refresh. Here is a video by Codecourse [this video] which will get you started in the right direction.

Recommends SheCodes · 2022-10 · Stack Overflow · on “Pass Success Message from PHP to HTML page after validation”

Multiple things here : 1- FIRST : DO NOT USE HTML FILES WHEN YOU USE PHP. it is more practical and less annoying to go all php even if your code is html only. so I'd create another file loginTest.php and transfer all loginTest.html contents into it ** 2- SECOND : the alert of success I recommend that you use jQuery along with jQuery UI. after adding the script links and the UI stylesheet : add a div after your form (with the content of your popup) give it an id <div id="divID" class="mt-5" title="Confirmed addition to the cart"> <p class="alert alert-info w-50" role="alert"> <strong>✅ You Have Successully Logged In</strong> </p> <button class="btn btn-success" name="continue" id="continue-bu

Cites Chris Kavanagh · 2015-05 · Stack Overflow · on “Where does .available method come from?”

I was going through this simple, short tutorial ( [this video] ) on jQuery & Ajax when I came to one line of code I don't understand. In the very short video it's line 13 in main.js. The line is if(data.available !== undefined) . My question is, where the heck does the .available method come from? This isn't explained in the tutorial/video, & it comes out of the blue as far as I'm concerned. Is it jQuery? Is it Ajax? Where does it come from? I'm assuming it's Ajax but I can't find any documentation on it. Any help is greatly appreciated. . .Here's the full Ajax code. . . $.ajax({ url: 'check/username.php', type: 'get', data: { username: target.val() }, dataType: 'json', success: function(data){ i