Around 8:00 I said "videos". I meant to say "files". Everything is in this one video. I did not get to the libraries but we will do that in a separate video. Hope you guys enjoy!
Another great tutorial again as usual. Please you promised to make a tutorial for beginners on how to create and upload website to the sever!!! Am still waiting - Thanks
Thanks for your HT. I have a question. I had to place send just after Open(); can you explain why? That was a problem I ran into; is it the current way to use?
Hey Brad, thanks you for teaching my how to send data to a database, I’m trying to send data using 3 input fields (first name, last name, email) and it just isn’t sending correctly, what do I need to change or add in the code to get working right, thanks...
@@TraversyMedia hey, since i started front-end learning, i always wondered how do one ever connnect front end to back-end. I think i have a better idea now. i watched some parts but i understood. Will practice the content of this video later on. Thanks, dont erase it plz (LOL).
Video intro 0:00 ; What is AJAX 0:57 ; XmlHttpRequest (XHR) Object 4:06 ; Ways to make AJAX Call 5:07 ; Starting with AJAX 7:24 ; onreadystatechange 18:42 ; onprogress & onerror 22:35 ; AJAX Dealing with JSON 26:40 ; AJAX with External API 37:20 ; AJAX with PHP 45:15 ; Connect to DB 1:01:12 ; Outro 1:09:10 ;
This is one of the most straight forward tutorials I've watched for JavaScript. Most videos post either pure basics or pretty advanced tutorials. Been searching for a video like this. Thanks for this video.
This is in my opinion the BEST video explaining AJAX on RUclips. I have scoured for hours and no other videos have explained the concept in such an understandable way. Thank you so so much. This is going to be so much help in Web dev classes at school. You, sir are a life saver.
I learned more with your videos in an hour than in all of the weekends of the past months.. I like the way you take the time to break things down and explain and diddle with the sections of code... The best i have ever seen... The way you play with things and break them is fantastic...
I don't believe that this courses are free and by the way Brad you're legacy but you need to lose some weight to be in your best health and to live longer so that we can pay you back for your contribution
it is really interesting that I can make a webpage, which is in some part adjustable but as I can copy some text from a local file, am I able to write them in the same text.txt file? I'm talking locally Great video btw.
Can't explain how happy I was to see this pop up in my notification. Couldn't wait to come home and watch it as if it was a game I recorded while I was away! Lol. Great video 👍
Just finished this, right after watching the JSON Crash Course. Two hours ago, JSON and Ajax didn't just make sense to me (I had used them a number of times, without understanding anything 🤧). Right now, I totally understand everything. Thanks a lot Brad. You're amazing.
i still can't get used to that. :) i find it silly. ;) but if it had been a library or a framework, than funnily enough, it wouldn't have sounded any more fancier, than the ones that are already out there. ^_^
The first button1 works, but it skips every other for some reason. Button #2 does not work...no matter what I do, the '{' tags do not match, and the browser throws and error. It must be in the 'for loop' but I've tried a hundred ways to fix it, and no result. I see your output, and I have the same code...looked at it a thousand times...it simply doesn't work. Using Chrome and Brave, and Opera....same result. The information is great...I just don't know why button#2 doesn't render. I wish the files contained the code for what was on the screen, so I could figure out my errors...but alas...they are not. So sad of an ending to such a great tutorial.
Woah how did you know I was looking for an Ajax tutorial?! I even watched your Json video yesterday and now you posted this. You're the man! Thanks brad
Brad, thank you very much. I sincerely appreciate this content and the time and effort you've invested into it. I basically never watch ads, but here, I left them running. I'm working on a couple web development projects right now, and I'll probably buy one of your JS courses on Udemy. Thanks again. :) Don't mind this section... just me making a couple bookmarks: 1:06:19 - using PHP file to fetch info from database and send it to html file as JSON 1:07:40 - parsing and using received JSON in html file Interesting to me, since I just use PHP files, taking info directly, even with AJAX. Brad's way seems safer.
Thank you, Brad. Your tutorials are awesome. You actually do things from scratch, and explain every step. Also, I like those types of videos as - "been showed - now practice", short and valuable. Great! Wish you all the best from Ukraine! :)
thanks lot for your courses on here, got this questions, once we retrieve data from json how can we pass it to lets say assign it ot a variable and be able to use it later on next functions and objects, pelase, herer the script i got sctuck, var xrequest = new XMLHttpRequest(); xrequest.open('GET', 'videos.json', true); xrequest.onreadystatechange = function(){ if(this.readyState == 4 && this.status == 200) { var json = JSON.parse(this.responseText); for(var i=0; i
Before i watch the full video, i hit the like button and then i watch the video, because i always know there something good i'm gonna learn from your tutorial.
Really good, solid tutorial. I'm doing a course currently and this was just baffling to me at first but you've just made it so much more accessible and easy to understand. Excellent, thank you.
This doesn't work on older browser and I never had a problem with it at all. SIMPLEST AJAX: function ajaxcall(a,b,c){ c=new XMLHttpRequest; c.open('POST',a);c.onload=b;c.send();} // AJAX CALL function ajaxfunc(){ confirm(this.response); } // AJAX FUNCTION AFTER PROCESS // ajaxcall('ajax.php',ajaxfunc); // THE FUNCTION CALL "C" is not needed.
Can I ask the community: in the last part of the video talking about calling PHP to interact with mySQL, why need to take this detour but not interacting with mySQL directly? Is it because JS is not capable to query mySQL? Great thanks to this video, I start my js from zero with Traversy. Excuse me if I asked a stupid question.
Great video Brad. One thing at the end - I got an error message: Uncaught SyntaxError: Unexpected token / in JSON at position 0 at JSON.parse ()... Can't see why, but something to do with the line: var users = JSON.parse(this.responseText); ?? (Maybe my settings in Xampp...) But thanks again for the great video, you always explain the WHY part of it! Ted from Winnipeg, Canada
On 58:00, during the "setRequestHeader" xhr parameter call, Brad says "applicationSLASHxDASHwwwDOTformDOTurlencoded" BUT HE MEANS TO SAY "applicationSLASHxDASHwwwDASHformDASHurlencoded"
In just an hour, I now quite get the XHR object and the kind of situations where it is useful i.e. display data from a url without having to do a full page reload. Thanks a tonne Brad.
everything except for php part was ok but there since i have 0 knowledge on php i had to use different guides on how to set up everything .and everything worked differently probably because i haven't done some steps.But i came here searching for front end part so i didn't wanted to go to deep in php
35:25 ajax2.html "Uncaught TypeError: cannot read prperty 'id' of null at XMLHttpRequest.xhr.onload (ajax2.html57) I remove the [i] and I get several loops of array key pairs with undefined as values. Any help would be nice. EDIT: Never mind...I changed loop from users to user and change key val pairs to singular ...user[i].id...and it works perfectly. Thanks
Why do we need to use onload and then send? Why can't we just do xhr.get("GET", "file.txt", true); and then console.log(this.responseText);? Also, why do you do "this.responseText" instead of "xhr.ReponseText"? I am a beginner with JS, and I am learning a lot through your video, thanks!
but, anyways, thanks for everything, i really appreciate all the lessons. i can now code in all web languages, including python and c++. your tutorials really helped as a startup. THANKS SOOOO MUCH
Hi, around 18:09, instead of status 200 I got an '304 not modified', also on the console I got an error like this: " Access to XMLHttpRequest at 'file:///C:/xampp/htdocs/ajaxcrash/sample.txt' from origin 'null' has been blocked by CORS policy: Cross origin requests are only supported for protocol schemes: http, data, chrome, chrome-extension, https. loadText @ ajax1.html:31 " Can someone help me plz, how to fix it?
14:47 any idea why open method isn't showing up under console.log(xhr) ? Sure you can check its presence via 'open' in xhr and also it will be showing in XMLHttpRequest.prototype. I thought for a second that maybe because it's not enumerable (enumerable: false) but actually it's not the case since Object.getOwnPropertyDescriptor(XMLHttpRequest.prototype, 'open').enumerable === true
Does anybody know how to access ajax1.html from localhost/ajaxcrash/ajax1.html? I installed xampp but can't seem to get any further than that! Thank you! Edit: If anyone else it stuck on this, had to move the 'ajaxcrash' folder inside C:\xampp\htdocs\
42:45 congrats, you created a good example of the XSS (Cross-Site-Scripting) vulnerability. PS. I was hoping for an SQL-Injection too, but you caught that one. So at least kudos there. Anyone watching -- DO NOT simply write text into your client website as innerHTML -- you need to encode html entities in it first!
I don't know why, but I can't run the first code (ajax1). It says 'Cannot read properties of null (reading 'addEventListener')'.I've tried also with the jQuery function .ready(), but it wasn't working.
Currently, I'm at an intermediate level in HTML CSS, and JS and noob about back-End that how PHP & MySQL works and relative b/w them. So, today I feel relaxed due to knowing the full-stack web app work somehow. Thanks for the video.
THANK YOU! It's so hard to find a good web dev tutorial nowadays that doesn't rely heavily on libraries (jQuery) or skips over many core concepts of how and WHY things work the way they do on the web.
I had an error, CORS issue: "from origin 'null' has been blocked by CORS policy: Cross origin requests are only supported for protocol schemes: http, data, chrome, chrome-extension, https."
Hi Brad, I not understand why xhr.open('GET', 'api.github.com/users', true); gives no problems in your example, because I get the error "No Access-Control-Allow-Origin header is presented on the requested resource" when I try to access another API server. I googled it and found things like "Same origin policy" is needed and no cross URL allowed. Please advice, thx.
Failed to load url: No 'Access-Control-Allow-Origin' header is present on the requested resource. Origin 'url.com' is therefore not allowed access. please do a video on Access-Control-Allow-Origin so that it will be very useful for all Thanks in advance :)
Can you do for using ajax libraries(jquery, axios etc..) for another videos, and we missed the topics in that please " Explain, How to use Post, Put , Delete method." Really helpful video for beginners with Ajax crash course
excellent video! as always. theres a small bug in there @25:51: it should be: ..else if(this.status == 404) {... double equals sign! the code seems to work, but its not actually checking for 404. it just always returns true. I checked your code archive and the bug is still in there. thank you brad for all your great work! love your channel!
Help please: I got everything working using Xampp and Brackets up until working with the .php file. I looked online and found some advice to try setting the Brackets Live Preview Base URL to localhost/AJAX crash but this didn't work. I tried several other ways to write the live preview base url. If anyone knows how to get Brackets working so I can complete the last two exercises in this tutorial, I would greatly appreciate your help. I plan to learn Node instead of php as I was advised that Php is "dead" but I just want to use these exercises to familiarize myself with AJAX.
I noticed that we've skipped the try-catch business in creating the XHR object. theNewBoston's tutorial on AJAX and others go through a series of try-catch statements to ensure the XHR object is created the right way based on browser. Was this step not done because its a deprecated technique? theNewBoston's tutorials are a little old (2013) and so I thought 'maybe now enough browsers uniformly support AJAX and the XMLHttpRequest object that the try-catch implementation is obsolete'. Is that the case?
Very good course, i still have an issue with the AJAX Form with POST method, looking at the console is "Proccessing..." for unlimited time without reaching the POST response.
Great video! Learned a lot!! First time to run Apache server and connect to MySQL, even able to use phpmyadmin!!! only took 30 times repeat and retry!!! Oh of course AJAX too!! Thanks
I'm stuck at the console.log(this.responseText) part at 17:37, but it isn't loading the text from the sample.txt file. I'm using Live Server on VS Code and I see in Network when I click the button, it shows up as Status 304.
Around 8:00 I said "videos". I meant to say "files". Everything is in this one video. I did not get to the libraries but we will do that in a separate video. Hope you guys enjoy!
Can you do a video on isotope and masonry please ? will be really helpful ,thanks :)
Another great tutorial again as usual. Please you promised to make a tutorial for beginners on how to create and upload website to the sever!!! Am still waiting - Thanks
Thanks a lot , Could you make some video for Javascript Flavours, like vanilla :P
Try GoLang instead of NodeJS. You have a good thought process
How do we use ajax in production without CORS errors?
Github pages?
Heroku?
Netlify?
Which of these will work?
wow. He explains very complicated stuffs so smoothly.
Of course man, this is Brad Traversy you're talking about
Incredible Course After 4 years, good job
liked your video soo much.. its good for begginers.. and i'm also a TWD fan ! :)
Can you make one for ES6?
you can easy do it by your own B)
Great tutorial Brad. Thanks
Excellent, thanks Brad. What changes would I need to make to use PDO instead of mysqli? The connection is not a problem, just the other stuff.
Thanks for your HT. I have a question. I had to place send just after Open(); can you explain why? That was a problem I ran into; is it the current way to use?
Please do a video on hosting multiple django projects with gunicorn nginx for reverse proxy.
Hey Brad, thanks you for teaching my how to send data to a database, I’m trying to send data using 3 input fields (first name, last name, email) and it just isn’t sending correctly, what do I need to change or add in the code to get working right, thanks...
I disable adblock when I watch this channel. Brad, you're a hero.
Thank you very much for that :)
I just whitelisted his channel too :)
i disable adblock donate to patreon and get his udemy courses
You mean you enabled adblock :) since disabling adblock means ads are free to come.
Lol?
this is the best AJAX course on the net by far Brad!
Thanks
Yes thank you brad
Definitely the best ajax tutorial!
better than Bucky's
@@TraversyMedia hey, since i started front-end learning, i always wondered how do one ever connnect front end to back-end. I think i have a better idea now. i watched some parts but i understood. Will practice the content of this video later on. Thanks, dont erase it plz (LOL).
Every time I hear that intro music, I feel really confident.
It gives me similar vibes as Netflix
I know, right?! It makes me feel like everything is going to be okay.
OMG Another awesome video from Traversy Media! Does he ever sleep or does he just make cool videos around-the-clock?
Traversy is a true hero
He's mr. robot
he sleeps
Looking at how much he work he will have tough time in 50s. I already lost my spinal cord. Now I am ghost.
Video intro 0:00 ;
What is AJAX 0:57 ;
XmlHttpRequest (XHR) Object 4:06 ;
Ways to make AJAX Call 5:07 ;
Starting with AJAX 7:24 ;
onreadystatechange 18:42 ;
onprogress & onerror 22:35 ;
AJAX Dealing with JSON 26:40 ;
AJAX with External API 37:20 ;
AJAX with PHP 45:15 ;
Connect to DB 1:01:12 ;
Outro 1:09:10 ;
This is one of the most straight forward tutorials I've watched for JavaScript. Most videos post either pure basics or pretty advanced tutorials. Been searching for a video like this.
Thanks for this video.
@14:45 for those wondering, the fx open is inherited from the XMLHttpRequest constructor and can be found under the prototype (__proto__) property.
This is in my opinion the BEST video explaining AJAX on RUclips. I have scoured for hours and no other videos have explained the concept in such an understandable way. Thank you so so much. This is going to be so much help in Web dev classes at school. You, sir are a life saver.
I learned more with your videos in an hour than in all of the weekends of the past months.. I like the way you take the time to break things down and explain and diddle with the sections of code... The best i have ever seen... The way you play with things and break them is fantastic...
Bye bye jQuery, going full vanilla now! :D
yeah, quite agree with you, vanilla javascript is the fundamental, no need to use those fancy libraries, it gets confused....
my words exactly :p
importing JQuery for a fetch request makes your application heavier, and JQuery isn't that much simpler anyway. It's time to move on.
yeah the native javascript api's are getting to the point where jQuery is no longer a "necessity".
hellloo
I don't believe that this courses are free and by the way Brad you're legacy but you need to lose some weight to be in your best health and to live longer so that we can pay you back for your contribution
it is really interesting that I can make a webpage, which is in some part adjustable but as I can copy some text from a local file, am I able to write them in the same text.txt file? I'm talking locally
Great video btw.
Can't explain how happy I was to see this pop up in my notification. Couldn't wait to come home and watch it as if it was a game I recorded while I was away! Lol. Great video 👍
Thats awesome, I hope you liked it
Just finished this, right after watching the JSON Crash Course.
Two hours ago, JSON and Ajax didn't just make sense to me (I had used them a number of times, without understanding anything 🤧).
Right now, I totally understand everything.
Thanks a lot Brad. You're amazing.
Idk if it's just me but I think doing AJAX with vanilla JS is a lot simpler than doing it with jQuery. Thanks Brad!
hey brad can you make tutos on handle payments plz like e-commerce project
Oh gosh, I thought vanilla JS was some complicated JS framework, lol.....only 0 bytes in size
i still can't get used to that. :) i find it silly. ;) but if it had been a library or a framework, than funnily enough, it wouldn't have sounded any more fancier, than the ones that are already out there. ^_^
You're such a great instructor. Thank you for teaching me a whole lot from your videos. :) very inspiring as well.
The first button1 works, but it skips every other for some reason. Button #2 does not work...no matter what I do, the '{' tags do not match, and the browser throws and error. It must be in the 'for loop' but I've tried a hundred ways to fix it, and no result. I see your output, and I have the same code...looked at it a thousand times...it simply doesn't work. Using Chrome and Brave, and Opera....same result. The information is great...I just don't know why button#2 doesn't render. I wish the files contained the code for what was on the screen, so I could figure out my errors...but alas...they are not. So sad of an ending to such a great tutorial.
Woah how did you know I was looking for an Ajax tutorial?! I even watched your Json video yesterday and now you posted this. You're the man! Thanks brad
"You may recognise these names here, if you're cool." hahahhahhaa
The walking dead 😎
thank you for taking the time off to create such good content. you have inspired me to help share my knowledge in the future.
Tysm for this tutorial definitely help me alot to create interactive stuff without reloading the actual page :D!
Brad, thank you very much. I sincerely appreciate this content and the time and effort you've invested into it. I basically never watch ads, but here, I left them running. I'm working on a couple web development projects right now, and I'll probably buy one of your JS courses on Udemy. Thanks again. :)
Don't mind this section... just me making a couple bookmarks:
1:06:19 - using PHP file to fetch info from database and send it to html file as JSON
1:07:40 - parsing and using received JSON in html file
Interesting to me, since I just use PHP files, taking info directly, even with AJAX. Brad's way seems safer.
Thank you, Brad. Your tutorials are awesome. You actually do things from scratch, and explain every step. Also, I like those types of videos as - "been showed - now practice", short and valuable. Great! Wish you all the best from Ukraine! :)
The most beneficial hour I've spent in the past few days. Thanks, Brad.
Great work through. I am an AJAX noob to be accurate, and this was a great way to get to know the tech. Much appreciated.
Hi how to send multiple variables in case of ajax with post method?
guys what type of data can be returned or requested by the xmlhttprequest object?
Walking dead array :)
hii sir,
when ever i make a request these errors pop up i dont understand what they are and how to overcome them please help me sir.
I've the same problem did you fix it ?
thanks lot for your courses on here, got this questions, once we retrieve data from json how can we pass it to lets say assign it ot a variable and be able to use it later on next functions and objects, pelase, herer the script i got sctuck,
var xrequest = new XMLHttpRequest();
xrequest.open('GET', 'videos.json', true);
xrequest.onreadystatechange = function(){
if(this.readyState == 4 && this.status == 200) {
var json = JSON.parse(this.responseText);
for(var i=0; i
What a very long tutorial.
which I've listen to, twice!
Before i watch the full video, i hit the like button and then i watch the video, because i always know there something good i'm gonna learn from your tutorial.
Best video Channel for learning programming thanks for helping my life
Should We Use Switch Case Instead Of Too Many If Elseif Statements ?
Really good, solid tutorial. I'm doing a course currently and this was just baffling to me at first but you've just made it so much more accessible and easy to understand. Excellent, thank you.
Who is here in october 2020??
iam here in november
DId the lorem50 (dummy text) work for you ? It works on my html file, but not in my txt file. i looked it up and there is something called emmet
here in January, 2021 :P :P
@@alinaspahiu8790 same
Me
Passed 4 Years, I still watching this. Love Brad.
Outstanding course ever 2025❤
This doesn't work on older browser and I never had a problem with it at all.
SIMPLEST AJAX:
function ajaxcall(a,b,c){ c=new XMLHttpRequest; c.open('POST',a);c.onload=b;c.send();} // AJAX CALL
function ajaxfunc(){ confirm(this.response); } // AJAX FUNCTION AFTER PROCESS
// ajaxcall('ajax.php',ajaxfunc); // THE FUNCTION CALL "C" is not needed.
Really helpful keep up the good work
One love ❤️
Thank you very much, it's very useful
36:49 work with external API
45:09 work with PHP
55:10 work with the post Request
Thanks
big thanks for making education free.
after 6 years still you are the best
You have really made my day with this crash course. OMG very easy to understand. Thanks so much for this video.
4.1k likes to freakin 35 dislikes... i think that says it all Brad.
And wtf is wrong with those 35 people?
This really helped me learn the ins and outs of AJAX! It was also a nice refresher for php & MySQL. Thanks Brad!
700 th comment
Awesome Ajax crash course
Can I ask the community: in the last part of the video talking about calling PHP to interact with mySQL, why need to take this detour but not interacting with mySQL directly? Is it because JS is not capable to query mySQL? Great thanks to this video, I start my js from zero with Traversy. Excuse me if I asked a stupid question.
Great video Brad. One thing at the end - I got an error message:
Uncaught SyntaxError: Unexpected token / in JSON at position 0
at JSON.parse ()... Can't see why, but something to do with the line:
var users = JSON.parse(this.responseText); ?? (Maybe my settings in Xampp...)
But thanks again for the great video, you always explain the WHY part of it!
Ted from Winnipeg, Canada
Hey, did you solve this error? I had the same problem here too =/
This was very helpfull for the understanding of AJAX. Thanks. I haven't started PHP yet but I understood the principle
At 25:48, isn't line 36 supposed to be *} elseif(this.status == 400) {*
At 25:48, isn't line 36 supposed to be } elseif(this.status == 404) {
On 58:00, during the "setRequestHeader" xhr parameter call, Brad says "applicationSLASHxDASHwwwDOTformDOTurlencoded" BUT HE MEANS TO SAY "applicationSLASHxDASHwwwDASHformDASHurlencoded"
Hi bro please help, I'm struggling to understand promises vs async , and fetch vs xhr
In just an hour, I now quite get the XHR object and the kind of situations where it is useful i.e. display data from a url without having to do a full page reload. Thanks a tonne Brad.
everything except for php part was ok but there since i have 0 knowledge on php i had to use different guides on how to set up everything .and everything worked differently probably because i haven't done some steps.But i came here searching for front end part so i didn't wanted to go to deep in php
Can you do a video responsive website with CSS grid?
HackerEarth has a good 3 part tutorial on CSS Grid
ruclips.net/video/moBhzSC455o/видео.html
These videos are invaluable. They serve as a great guide to html, css, ajax, etc particularly when reviewing videos from other providers
35:25 ajax2.html "Uncaught TypeError: cannot read prperty 'id' of null at XMLHttpRequest.xhr.onload (ajax2.html57)
I remove the [i] and I get several loops of array key pairs with undefined as values. Any help would be nice.
EDIT: Never mind...I changed loop from users to user and change key val pairs to singular ...user[i].id...and it works perfectly.
Thanks
Why do we need to use onload and then send? Why can't we just do
xhr.get("GET", "file.txt", true); and then
console.log(this.responseText);?
Also, why do you do "this.responseText" instead of "xhr.ReponseText"?
I am a beginner with JS, and I am learning a lot through your video, thanks!
Hello Mr.Brad Traversy, i finished the video and just wanna say THANK YOU!!!
but, anyways, thanks for everything, i really appreciate all the lessons.
i can now code in all web languages, including python and c++.
your tutorials really helped as a startup.
THANKS SOOOO MUCH
Hi, around 18:09, instead of status 200 I got an '304 not modified', also on the console I got an error like this:
" Access to XMLHttpRequest at 'file:///C:/xampp/htdocs/ajaxcrash/sample.txt' from origin 'null' has been blocked by CORS policy: Cross origin requests are only supported for protocol schemes: http, data, chrome, chrome-extension, https.
loadText @ ajax1.html:31 "
Can someone help me plz, how to fix it?
14:47 any idea why open method isn't showing up under console.log(xhr) ?
Sure you can check its presence via 'open' in xhr and also it will be showing in XMLHttpRequest.prototype.
I thought for a second that maybe because it's not enumerable (enumerable: false) but actually it's not the case since Object.getOwnPropertyDescriptor(XMLHttpRequest.prototype, 'open').enumerable === true
Wow thank you...
I now.. really really understand to ajax with vanila javascript.. in 2021 year, i watching to your RUclips channel ❤️
Does anybody know how to access ajax1.html from localhost/ajaxcrash/ajax1.html? I installed xampp but can't seem to get any further than that! Thank you!
Edit: If anyone else it stuck on this, had to move the 'ajaxcrash' folder inside C:\xampp\htdocs\
Thank you so much about the video. It's the best AJAX tutorial video I've ever have!
42:45 congrats, you created a good example of the XSS (Cross-Site-Scripting) vulnerability.
PS. I was hoping for an SQL-Injection too, but you caught that one. So at least kudos there.
Anyone watching -- DO NOT simply write text into your client website as innerHTML -- you need to encode html entities in it first!
I don't know why, but I can't run the first code (ajax1). It says 'Cannot read properties of null (reading 'addEventListener')'.I've tried also with the jQuery function .ready(), but it wasn't working.
Currently, I'm at an intermediate level in HTML CSS, and JS and noob about back-End that how PHP & MySQL works and relative b/w them. So, today I feel relaxed due to knowing the full-stack web app work somehow. Thanks for the video.
Extremely useful!! That's what i've been searching for. Thank you for the time spent on this lesson!
THANK YOU! It's so hard to find a good web dev tutorial nowadays that doesn't rely heavily on libraries (jQuery) or skips over many core concepts of how and WHY things work the way they do on the web.
Great video Brad! I know this is almost 5 years late, but has anyone gotten this error at the very end on ajax 5? Unexpected token '
I had an error, CORS issue:
"from origin 'null' has been blocked by CORS policy: Cross origin requests are only supported for protocol schemes: http, data, chrome, chrome-extension, https."
Hi Brad, I not understand why xhr.open('GET', 'api.github.com/users', true); gives no problems in your example, because I get the error "No Access-Control-Allow-Origin header is presented on the requested resource" when I try to access another API server. I googled it and found things like "Same origin policy" is needed and no cross URL allowed. Please advice, thx.
Failed to load url: No 'Access-Control-Allow-Origin' header is present on the requested resource. Origin 'url.com' is therefore not allowed access.
please do a video on Access-Control-Allow-Origin so that it will be very useful for all
Thanks in advance :)
Can you do for using ajax libraries(jquery, axios etc..) for another videos, and we missed the topics in that please
" Explain, How to use Post, Put , Delete method."
Really helpful video for beginners with Ajax crash course
Hi Brad u r awesome. Can you make video on quize app with JavaScript and back end
excellent video! as always.
theres a small bug in there @25:51:
it should be: ..else if(this.status == 404) {...
double equals sign!
the code seems to work, but its not actually checking for 404. it just always returns true.
I checked your code archive and the bug is still in there.
thank you brad for all your great work! love your channel!
Help please: I got everything working using Xampp and Brackets up until working with the .php file. I looked online and found some advice to try setting the Brackets Live Preview Base URL to localhost/AJAX crash but this didn't work. I tried several other ways to write the live preview base url. If anyone knows how to get Brackets working so I can complete the last two exercises in this tutorial, I would greatly appreciate your help.
I plan to learn Node instead of php as I was advised that Php is "dead" but I just want to use these exercises to familiarize myself with AJAX.
I noticed that we've skipped the try-catch business in creating the XHR object. theNewBoston's tutorial on AJAX and others go through a series of try-catch statements to ensure the XHR object is created the right way based on browser. Was this step not done because its a deprecated technique? theNewBoston's tutorials are a little old (2013) and so I thought 'maybe now enough browsers uniformly support AJAX and the XMLHttpRequest object that the try-catch implementation is obsolete'. Is that the case?
Very good course, i still have an issue with the AJAX Form with POST method, looking at the console is "Proccessing..." for unlimited time without reaching the POST response.
Great video! Learned a lot!! First time to run Apache server and connect to MySQL, even able to use phpmyadmin!!! only took 30 times repeat and retry!!! Oh of course AJAX too!! Thanks
I'm stuck at the console.log(this.responseText) part at 17:37, but it isn't loading the text from the sample.txt file. I'm using Live Server on VS Code and I see in Network when I click the button, it shows up as Status 304.
SyntaxError: JSON.parse: unexpected character at line 1 column 1 of the JSON data
Please help iam having this error for ajax5.html
instructions unclear learned Asynchronous JavaScript and XML
also know as AJAX
Hi bro. Can I use thymeleaf annotations th:text, th:block, th:value, etc in the innerHTML you are appending in this code?
Hey, does anyone else have problems with CORS policy blocking this from working? How can I fix it, and why doesn't it happen in this tutorial?