Click here to Skip to main content
13,046,679 members (72,187 online)
Click here to Skip to main content


19 bookmarked
Posted 2 Dec 2010

Observer Pattern in web applications (JavaScript): A walkthrough with an AJAX example

, 2 Dec 2010
Observer pattern is an excellent technique to deal with one to many relationships among objects.
function createXMLHttp(){
                oXmlHttp= new XMLHttpRequest();
                return oXmlHttp
        } else {
                var aVersions=["MSXML2.XMLHttp.5.0",

               for(var i=0; i<aVersions.length; i++){
                               var oXmlHttpNew=new ActiveXObject(aVersions[i]);
                               return oXmlHttp;
                       } catch(oError) {

               throw new Error("XMLHttp object could not be created");

By viewing downloads associated with this article you agree to the Terms of Service and the article's licence.

If a file you wish to view isn't highlighted, and is a text file (not binary), please let us know and we'll add colourisation support for it.


This article, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)


About the Author

Albin Abel
Software Developer
India India
I am developer in .Net and GIS.

You may also be interested in...

Permalink | Advertise | Privacy | Terms of Use | Mobile
Web02 | 2.8.170713.1 | Last Updated 2 Dec 2010
Article Copyright 2010 by Albin Abel
Everything else Copyright © CodeProject, 1999-2017
Layout: fixed | fluid