JavaScript: Post to PHP (AJAX)

preview_player
Показать описание
A video tutorial showing you how to post JavaScript variables to PHP using AJAX

Рекомендации по теме
Комментарии
Автор

🙏 finally a concise and accurate source of information on this subject. Thank you, you saved my final project 😭

laffypanda
Автор

This video you took 9 years ago worked for me today thank you

fatihtutar
Автор

thank you for your code because it helped me in completing my project (Date : 10 oct 2023, Time : 2:20AM)

DevendraSingh-sfvo
Автор

This is just what I have been looking for. It's brill. Clear and concise.
I like the way you can run PHP script WITHOUT having to refresh the home page.
Thank you for sharing the information.

rdnewsham
Автор

AJAX means to use client programming to update or change the webpage in some way without actually refreshing the page. In this case we are sending some data to a PHP script which can be ran on the server making it possible to make server changes, once again without refreshing the page.

abell
Автор

Thanks for the TUTs, i've been looking for this a whole week. THanks man... keep up the good work

JimmyDedicat
Автор

Thank you so After spending a whole day (and night) trying to figure out what's going wrong, I had the great opportunity to find your video! Again, thanks a lot!

poulioumaria
Автор

Men I was going crazy fo days with an error of undefined index when I was using ajax. Thanks you have saved my career

admhngla
Автор

God bless you my brother, this really helped me, have been looking for something like this

rotimiidowu
Автор

I was searching searching... and was worried also... Found this and implemented it... God Bless You for making a good useful video.... Also please do make some more nice videos on advanced topics...

RNRSeries-Mysuru
Автор

Hey thanks for your tutorial I'm new at programming and I have a website that is php but I'm using JavaScript for programming my game that I want add to my site is this the way to go about doing it?

bigcitydreamz
Автор

Great video!!

I have a question, if I wanted to use this on a link instead of a button like the video, how could I get it to work? I've tried embedding the $.post function from your video into a click function for the link so far and it works by getting the elementID (a unique id for that anchor tag) and storing it in a variable. This part works. However, getting it to post to my php file thus far has been unsuccessful . It's for a project in college so any help at all would be appreciated!!

deanoz
Автор

Made my day. Great tutorial, well explained. God bless :)

shaadali
Автор

Great Job! Greetings from Poland! Thank You very much!

Автор

where should i find or download jquery.js file which one use in ur video plz advice thank u very much for ur video

santunu
Автор

So i would recommend using json enode instead of just echoing 1 Or 0

voze
Автор

I downloaded the jquery-1.12.1.min.js file then added the javascript you show in the tutorial to the bottom of this file, then post the source in the html <head>. It works fine, but I'm curious if this is the "correct" or "standard" way to do it?

Great tutorial by the way...

lukebiller
Автор

Hello, I am not sure how much you check YouTube but I thought it would be worth a post. First off, thank you for posting this, it is extremely helpful. However I am running into a couple of problems. Namely, my variables like your "postage" are not being recognized by my PHP. Also, I am not entirely sure where the post() and .val() functions came from, as they don't seem to be initialized anywhere. I am assuming they are predetermined by jquery or something, but that would be useful to know. Regardless, my form calls another js function as an action, and originally I had no intentions of adding a submit button, though I would if it will work. When I added it, it wasn't submitting the form... Currently I have-> action=function1() onsubmit=function2()  I Need my "result" to be shown in a <span> and not a <div> do you know how I could make that happen? I tried span.variableName instead of #variableName  but that didn't seem to work.  Thanks!

aprilcummings
Автор

what if the script is not inside div tag?
then what should i use instead of $('#result')

virendrasinghbais
Автор

Yes if you put this onto a button or link so it only happens when a function is ran and not when the page actually loads.

abell
visit shbcf.ru