XML
  Home arrow XML arrow Page 3 - 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  
Mobile Linux 
App Generation ROI 
IBM® developerWorks 
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 - Collecting connection data: defining the "getFormValues()" function


    (Page 3 of 6 )

    As I described above, all the "getFormValues()" function does is get the values entered by the user when trying to establish a connection to the mail server. In plain English this means obtaining the name or IP address of the mail server, along with the corresponding username/password combination, to be transmitted in the form var1=value1&var2=value2...&varN=valueN.

    As you know, this is really a simple task to do, so the signature for the function is the following:

    function getFormValues(fobj){
        var str='';
        for(var i=0;i< fobj.elements.length;i++){
            str+=fobj.elements[i].name+'='+ escape(fobj.elements
    [i].value)+'&';
        }
        str=str.substr(0,(str.length-1));
        return str;
    }

    Here, the above function accepts the web form to be processed as the one input argument and loops over its fields, in order to get the values in question. After the iteration process on the form has been performed, the function returns the form values, as an appropriately formatted string, to the calling code. Simple and sweet.

    At this stage, I've demonstrated how the POP3 client can connect to the mail server, after submitting the correct data combination. However, assuming that the connection was successfully established...how are the email messages displayed on the web page? To answer this question, I'll define another useful function, which I called "fetchMessages()," tasked with showing messages retrieved from the mail server.

    Let's jump to the next section and see how this function works.

    More XML Articles
    More By Alejandro Gervasio


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

    XML ARTICLES

    - Using Regions with XSL Formatting Objects
    - Using XSL Formatting Objects
    - More Schematron Features
    - Schematron Patterns and Validation
    - Using Schematron
    - 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







    © 2003-2009 by Developer Shed. All rights reserved. DS Cluster 6 Hosted by Hostway
    For more Enterprise Application Development news, visit eWeek