JavaScript
  Home arrow JavaScript arrow Storing Banner Data in MySQL Tables for a ...
Dev Articles Forums 
ADO.NET  
Apache  
ASP  
ASP.NET  
C#  
C++  
ColdFusion  
COM/COM+  
Delphi-Kylix  
Design Usability  
Development Cycles  
DHTML  
Embedded Tools  
Flash  
Graphic Design  
HTML  
IIS  
Interviews  
Java  
JavaScript  
MySQL  
Oracle  
Photoshop  
PHP  
Reviews  
Ruby-on-Rails  
SQL  
SQL Server  
Style Sheets  
VB.Net  
Visual Basic  
Web Authoring  
Web Services  
Web Standards  
XML  
Dedicated Servers  
Actuate Whitepapers 
Moblin 
IBM® developerWorks 
Sun Developer Network 
Weekly Newsletter
 
Developer Updates  
Free Website Content 
 RSS  Articles
 RSS  Forums
 RSS  All Feeds
Write For Us Get Paid 
Request Media Kit
Contact Us 
Site Map 
Privacy Policy 
Support 
 USERNAME
 
 PASSWORD
 
 
  >>> SIGN UP!  
  Lost Password? 
JAVASCRIPT

Storing Banner Data in MySQL Tables for a Dynamic Banner System with AJAX
By: Alejandro Gervasio
  • Search For More Articles!
  • Disclaimer
  • Author Terms
  • Rating: 4 stars4 stars4 stars4 stars4 stars / 5
    2007-08-01

    Table of Contents:
  • Storing Banner Data in MySQL Tables for a Dynamic Banner System with AJAX
  • Listing the entire source files of the previous banner application
  • Fetching banner data from MySQL
  • Completing the banner application

  • Rate this Article: Poor Best 
      ADD THIS ARTICLE TO:
      Del.ici.ous Digg
      Blink Simpy
      Google Spurl
      Y! MyWeb Furl
    Email Me Similar Content When Posted
    Add Developer Shed Article Feed To Your Site
    Email Article To Friend
    Print Version Of Article
    PDF Version Of Article
     
     
    ADVERTISEMENT

    Stay one step ahead of the competition. Evaluate and give feedback on some of the hottest web development tools on the market today. Make your opinion heard! Click Here

    Storing Banner Data in MySQL Tables for a Dynamic Banner System with AJAX


    (Page 1 of 4 )

    If you're a web developer searching for a guide on how to build a dynamic banner application with AJAX, look no further. This series of articles might be what you need. Welcome to the final tutorial of the series that began with "Creating a Dynamic Banner System with AJAX." Made up of three articles, this series develops a basic web application that uses AJAX-based HTTP requests to display a group of dynamic banners based on a predefined time sequence.

    Introduction

    Now that you hopefully have a clear idea of the topics covered by this series, let me reintroduce some important concepts surrounding the implementation of this AJAX-driven banner mechanism, which were deployed in the previous article. As you'll possibly recall, over the course of that tutorial I introduced some changes to the original structure of the original banner system, specifically modifying the definition of one of its primary JavaScript functions, called "displayBanner()."

    The most evident consequence in doing this modification was providing the application with the capacity to fetch the set of predefined banners directly from a simple XML file. This change enabled us to avoid needing the code and additional PHP file that initially retrieved all of the banner data from a plain text file. Additionally, since the aforementioned JavaScript function used the XML part of AJAX to display the different banners periodically on the browser, its overall structure became slightly more compact and maintainable.

    All right, at this point I already mentioned all the pros of this AJAX-driven application, but I purposely didn't stress its main weakness, so I believe now is a good time to do it, right? As you'll probably remember, the sequence in which the different banners were shown was originally controlled by a unique, global JavaScript variable. This approach can not be recommended in terms of good programming habits.

    Thus, considering that this issue should be fixed quickly, in this last installment of the series I'm going to adapt the original structure of the banner system to give it the ability to read all the banner-related data from a simple MySQL database table. In this way we will naturally avoid relying on a rather undesirable global JavaScript variable.

    Now, let's get rid of the preliminaries and learn together how to modify the original AJAX application to work with a basic MySQL database table. Hopefully, it's going to be an instructive experience!

    More JavaScript Articles
    More By Alejandro Gervasio


       · Over the course of this last installment of the series, the original banner...
     

    JAVASCRIPT ARTICLES

    - Detect Browser Compatibility with the Reques...
    - Using the EXT JS Date Picker Widget
    - Ajax Hack for Entering Information Without R...
    - EXT JS 2.1 Overview
    - Using the Style Object for Zebra Tables with...
    - Binary Searching
    - An Improved Approach to Building Zebra Tables
    - Assigning Background Colors Dynamically to Z...
    - Building Zebra Tables with CSS and JavaScript
    - JavaScript: Array Objects
    - A Closer Look at Smart Markers with Yahoo! M...
    - Using Polylines and Smart Markers with Yahoo...
    - Bulleted Menu of Links
    - Creating Click Loggers and Basic Markers wit...
    - Adding Pan Controls to Yahoo! Maps







    © 2003-2008 by Developer Shed. All rights reserved. DS Cluster 4 hosted by Hostway