XML
  Home arrow XML arrow Page 5 - Take AJAX to your Email Inbox: Developing ...
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  
Moblin 
JMSL Numerical Library 
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? 
XML

Take AJAX to your Email Inbox: Developing the Client-side Application Layer
By: Alejandro Gervasio
  • Search For More Articles!
  • Disclaimer
  • Author Terms
  • Rating: 4 stars4 stars4 stars4 stars4 stars / 6
    2006-04-05

    Table of Contents:
  • Take AJAX to your Email Inbox: Developing the Client-side Application Layer
  • Connecting to the mail server: defining the "sendHttpRequest()" function
  • Collecting connection data: defining the "getFormValues()" function
  • Displaying email messages: defining the "fetchMessages()" function
  • Initializing the POP3 client: defining the "initializeUserPanel()" function
  • Integrating the POP 3 client: listing the complete source code of the 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


    Take AJAX to your Email Inbox: Developing the Client-side Application Layer - Initializing the POP3 client: defining the "initializeUserPanel()" function


    (Page 5 of 6 )

    As I mentioned before, there's still one last function to be defined, in order to initialize the POP3 client. This function, which I called "initializeUserPanel()," is defined as follows:

    function initializeUserPanel(){
        // get 'connect' button
        var sendbtn=document.getElementsByTagName('form')[0].elements
    ['connect'];
        // send http request when button is clicked on
        sendbtn.onclick=function(){

            // send request & fetch messages from POP3 server
            sendHttpRequest('pop_processor.php','fetchMessages');
            // display 'Retrieving...' message
            var mdiv=document.getElementById('mailcontainer');
            if(!mdiv){return};
            mdiv.innerHTML='Retrieving messages from the server...';
        }
    }

    In the simplest sense, all the above function does is tie the "sendHttpRequest()" function to the "connect" button, so the HTTP request will be triggered when the user clicks on it. Notice how I passed, as parameters, the PHP file responsible for connecting and retrieving email messages, along with the callback function ("fetchMessages()"), which processes and displays the messages on the web page.

    The last thing the function does is simply display the legend "Retrieving messages from the server..." while the processes for connecting to the mail server and retrieving messages are running in the background.

    At this point, I provided you with all of the JavaScript functions that comprise this web-based POP3 client, which means in basic terms that we have now developed the whole client-side application layer. That said, it's time to summarize what you learned until now and list the full source code of the JavaScript application. Don't worry. It's only a few lines away.

    More XML Articles
    More By Alejandro Gervasio


       · In this second article, all the JavaScript functions that comprise that client-side...
     

    XML ARTICLES

    - Datatypes and More in RELAX NG
    - Providing Options in RELAX NG
    - An Introduction to RELAX NG
    - Path, Predicates, and XQuery
    - Using Predicates with XQuery
    - Navigating Input Documents Using Paths
    - XML Basics
    - Introduction to XPath
    - Simple Web Syndication with RSS 2.0
    - Java UI Design with an IDE
    - UI Design with Java and XML Toolkits
    - Displaying ADO Retrieved Data with XML Islan...
    - Widget Walkthrough
    - Introduction to Widgets
    - The Why and How of XML Data Islands







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