In the first article in this series, we developed a simple PHP function that dynamically generates a JavaScript array and populates it with external incoming data. In this article, we will develop a real world application using this method, in the form of a news ticker.
This is the second part of the series "PHP and JavaScript Interaction: Storing Data in the Client." Welcome back! If you've been following the concepts covered in the first article, then you probably have grasped the underlying ideas behind the approach taken to store data (text files or database records) directly in JavaScript arrays, avoiding additional or unnecessary server loads.
Having thoroughly covered the pros and cons of this method, we made an attempt to develop a simple PHP function that dynamically generates a JavaScript array, populating it with external incoming data, that is, file data or table records. Once that structure was created, the question spinning in our minds was the following: can we develop a real application where this method finds its place?
The good news is that we're able to implement several applications, at least, at a limited scale. Here, we're not pointing toward the big project that will change your life as developer. Instead, we're aiming to create small projects and put this approach to work, taking advantage of its benefits. So, keeping that idea in mind, in this second part, we'll create a text file-based JavaScript news ticker, as a learning process to introduce a practical use for the technique previously defined. Are you ready to work with a pinch of PHP and JavaScript? Fine, let's get started!
Comments
Be the first to write a comment
You must me logged in to write a comment.