Hello everyone. I am trying to bring my focus again on web development (after spending alot of time working on Mac server IT issues). I am currently investigating AJAX. I know the basics of web (HTML and whatnot), client side scripting (javascript), and my favorite server side scripting language (PHP). I found several online tutorials about the integration of PHP with AJAX, but I am still confused how AJAX works. Let me try to explain to you so you can see if I got things right:
So AJAX is basically Javascript capable of passing data on the web without the need of refresh the page or moving to a different page. Usually data is (most of the time) inputted from HTML forms. This data is passed to Javascript via an event that is applied on the HTML form elements. In Javascript, an XMLHttpRequest request is initialized (the proper request must be used according to the browser). When the request is ready, a function should be executed, so in this function we define what will be done with what data we have. We open the request with a page URL and a method (GET? POST?), then send the data.
Is this how things work between AJAX and PHP?
I am trying to make form that contains several textarea elements. Is there a way that can let me enter all the data in the textareas then hit a button that sends the data to my PHP file without refreshing the page? So far I have seen examples where only 1 textbox is used, but how can I apply this for several textareas. Also is there a way that after the data is transferred to PHP I reload only the textareas and load them with the previously typed data, or does require at least a single page refresh?
Thanks for any feedback!
So AJAX is basically Javascript capable of passing data on the web without the need of refresh the page or moving to a different page. Usually data is (most of the time) inputted from HTML forms. This data is passed to Javascript via an event that is applied on the HTML form elements. In Javascript, an XMLHttpRequest request is initialized (the proper request must be used according to the browser). When the request is ready, a function should be executed, so in this function we define what will be done with what data we have. We open the request with a page URL and a method (GET? POST?), then send the data.
Is this how things work between AJAX and PHP?
I am trying to make form that contains several textarea elements. Is there a way that can let me enter all the data in the textareas then hit a button that sends the data to my PHP file without refreshing the page? So far I have seen examples where only 1 textbox is used, but how can I apply this for several textareas. Also is there a way that after the data is transferred to PHP I reload only the textareas and load them with the previously typed data, or does require at least a single page refresh?
Thanks for any feedback!