AJAX
  Home arrow AJAX arrow Page 3 - The Ajax Approach to ACP: A Simple Example
Dev Shed Forums  
Administration  
AJAX  
Apache  
BrainDump  
DHTML  
Flash  
Java  
JavaScript  
Multimedia  
MySQL  
Oracle  
Perl  
PHP  
Practices  
Python  
Reviews  
Security  
Smartphone Development  
Style-Sheets  
Web Services  
XML  
Zend  
Zope  
Mobile Linux  
App Generation ROI  
IBM® developerWorks  
Forums Sitemap  
E-Commerce Hosting  
Linux Web Hosting  
Managed Hosting  
Small Business Hosting  
VPS Hosting  
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? 
Google.com  
AJAX

The Ajax Approach to ACP: A Simple Example
By: Chrysanthus Forcha
  • Search For More Articles!
  • Disclaimer
  • Author Terms
  • Rating: starstarstarstarstar / 4
    2008-10-21


    Table of Contents:
  • The Ajax Approach to ACP: A Simple Example
  • The Simple Example Code
  • The Script in the DIV in the BODY
  • The Back Button

  • Rate this Article: Poor Best 
      ADD THIS ARTICLE TO:
      error-file:tidyout.log Del.ici.ous error-file:tidyout.log Digg
      error-file:tidyout.log Blink error-file:tidyout.log Simpy
      error-file:tidyout.log Google error-file:tidyout.log Spurl
      error-file:tidyout.log Y! MyWeb error-file:tidyout.log 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


    The Ajax Approach to ACP: A Simple Example - The Script in the DIV in the BODY
    ( Page 3 of 4 )

    In this section, I talk about the script at the bottom of the first page. This script is in the BODY element. Remember that JavaScript in the HEAD element is executed when it is called, while JavaScript in the BODY element is executed when the page is loaded. This is the script:


    <script type="text/javascript">

     

    var xmlHttp;

     

    try

    {

    // Firefox, Opera 8.0+, Safari

    xmlHttp=new XMLHttpRequest();

    }

    catch (e)

    {

    // Internet Explorer

    try

    {

    xmlHttp=new ActiveXObject("Msxml2.XMLHTTP");

    }

    catch (e)

    {

    try

    {

    xmlHttp=new ActiveXObject("Microsoft.XMLHTTP");

    }

    catch (e)

    {

    alert("Your browser does not support AJAX!");

    }

    }

    }


    xmlHttp.onreadystatechange=function()

    {

    if(xmlHttp.readyState==4)

    {

    theArray[2] = xmlHttp.responseText;

    }

    }

     

    xmlHttp.open("GET","sendText.pl",true);

    xmlHttp.send(null);

    </script>


    The features here are the same as in the previous part of the series. The only difference is that, in the previous part of the series, all of these statements are in a function. Here they are not in a function, so they are executed as the page is loaded. I will not repeat the explanation of the code.

    The complete code can be downloaded at:


    ajaxApproach.ZIP




     
     
    >>> More AJAX Articles          >>> More By Chrysanthus Forcha
     

       

    AJAX ARTICLES

    - PHP AJAX Form Validation
    - Completing a User-Defined CSS Website with P...
    - Create a User-Defined CSS Website with PHP
    - Build A Better Twitter Chat Client Than Cham...
    - Using Division Equations to Make Web Forms S...
    - Using Integer Multiplication to Protect Web ...
    - Using Simple Checksums for Web Form Verifica...
    - Protecting Web Forms with AJAX
    - Using Prototip with AJAX
    - Using Prototip
    - Using the google.load() Method with Google`s...
    - How to Handle Ajax Errors
    - Uncompressing Source Files with Google`s AJA...
    - Using the jQuery Framework with Google`s Aja...
    - Using Google`s Ajax Libraries API




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