Home arrow PHP arrow PHP and JavaScript Interaction: Storing Data in the Client - Part 2

PHP and JavaScript Interaction: Storing Data in the Client - Part 2

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.

  1. PHP and JavaScript Interaction: Storing Data in the Client - Part 2
  2. A brief look at the "createJavaScript()" function
  3. Working in the client side: the JavaScript news ticker
  4. Defining the JavaScript functions
  5. A practical approximation: showing the news ticker in action
By: Alejandro Gervasio
Rating: starstarstarstarstar / 15
May 09, 2005

print this article




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!

>>> More PHP Articles          >>> More By Alejandro Gervasio

blog comments powered by Disqus
escort Bursa Bursa escort Antalya eskort


- Hackers Compromise PHP Sites to Launch Attac...
- Red Hat, Zend Form OpenShift PaaS Alliance
- PHP IDE News
- BCD, Zend Extend PHP Partnership
- PHP FAQ Highlight
- PHP Creator Didn't Set Out to Create a Langu...
- PHP Trends Revealed in Zend Study
- PHP: Best Methods for Running Scheduled Jobs
- PHP Array Functions: array_change_key_case
- PHP array_combine Function
- PHP array_chunk Function
- PHP Closures as View Helpers: Lazy-Loading F...
- Using PHP Closures as View Helpers
- PHP File and Operating System Program Execut...
- PHP: Effects of Wrapping Code in Class Const...

Developer Shed Affiliates


Dev Shed Tutorial Topics: