HomePHP PHP and JavaScript Interaction: Storing Data in the Client, part 3
PHP and JavaScript Interaction: Storing Data in the Client, part 3
In the final article in our series about using PHP and JavaScript to store data on the client side, we will be building on what we learned about server and client interaction to create a JavaScript-based paginating system.
Welcome to the final part of the series "PHP and JavaScript Interaction: Storing Data in the Client." Definitely, it's been a highly satisfactory experience to deeply explore the possibilities of the PHP-JavaScript interaction process, which offers a wide range of possible applications in Web projects.
While the subject is far too extensive for being completely treated in a couple of articles, from my point of view, I've tried to contribute a bit by explaining a simple approach for storing server-side data in JavaScript arrays.
Following this technique, I've developed a "createJavaScript()" PHP function, which is fed with server-side data (files or result sets), and returns a JavaScript array populated with these contents. For a full review of this function, please return to part one of this series. While this function is not going to blow your mind away, it has proven to be handy in the development of certain applications that may be suitable for small web projects.
In the second part, we added another toy to our developer's toolbox by creating a file-based news ticker, simply by manipulating JavaScript arrays. Maybe you're wondering…so what? There are hundreds of those tiny applications out there, ready for copy-and-paste action! Fine, despite the important concept of code reusability, nothing stops us from using PHP and JavaScript to create our own programs.
Considering this, our next and final step will be using this server-client programming interaction to build a JavaScript-based paging system. I mean <previous> 1, 2, 3, …and so forth. Is such a thing possible? Yes, it is. Let's put our hands to the hard work and start learning more.