On Fri, 2007-03-16 at 14:59 -0400, Ronald J Kimball wrote: 

> Sean Quinlan gave a demonstration of a simple but useful AJAX application
> and showed us how easy it is to create one.  Watch for a post from Sean
> with links to resources.


Here are a few links you might find useful on the subject.

Javascript - the first two are for javascript packages that provide a
lot of useful functions to help write AJAX applications (as well as do
other nifty things), which handle most of the cross-browser special case
handling for you. IIRC prototype is used in jifty. The w3schools site
most of you are probably already familiar with. While their tutorials
are not very deep, they come with lots of examples that you can edit and
play with, and I've found them to be a useful first step or refresher.:
http://www.prototypejs.org/
http://script.aculo.us/
http://www.w3schools.com/js/default.asp

AJAX (XML HTTP Request) - the first link is to an article describing the
concept of AJAX by Jesse Garret, who is credited with coining the term
AJAX. The article probably marks the beginning point when the concept
started really gaining general momentum. The second is the best
quick-start explanation of creating and using an HTTPRequest object that
I found when I first set out to learn how to use it. The author also
regularly updates the page so it is relatively current.
http://www.adaptivepath.com/publications/essays/archives/000385.php
http://jibbering.com/2002/4/httprequest.html

As I mentioned in my talk, if you haven't used javascript yet, or
recently, you may be pleasantly surprised. While it is certainly has
some browser support issues, they seem to have been pushed out to the
edges a bit. And while it is still a fairly limited language, Perl
programmers will likely find the current syntax quite comfortable.
Indeed, when writing some javascript in a hurry, I've mistakenly used my
instead of var on more than one occasion. Javascript has all the basic
control structures, excellent regex support (using a subset of Perls
syntax) and even associative arrays (functionally). While I personally
still prefer to do all my heavy lifting on the server I've recently
found that javascript is able enough to push some simple functionality
back to the user. And I've found the UI advances available through AJAX
(not that I've bothered with the XML part yet ;) to be very seductive;
it opens up interface possibilities for web pages that I never would
have though possible, or at least supportable, just a few years ago.

On the down side, I have yet to find a good, comprehensive, _up to date_
javascript reference online, so when I'm trying to find out if it is
possible to do something, or correct some syntax, I'm frequently reduced
to a cycle of googling around for ideas. If anyone knows of one, please
post the link!

Lastly, here is the code I'm currently using to get an HTTPRequest
object, which has been tested for IE 6 & 7, Firefox 1.5 & 2 and
Konqueror 3.5 and Opera 9:
// for scripts needing an XMLHttpRequest object
function make_xmlhttp() {
        var xmlhttp = false;
        
        /[EMAIL PROTECTED] @*/
        /[EMAIL PROTECTED] (@_jscript_version >= 5)
        // JScript gives us Conditional compilation, we can cope with old IE
versions.
        // and security blocked creation of the objects.
         try {
          xmlhttp = new ActiveXObject("Msxml2.XMLHTTP");
         } catch (e) {
          try {
           xmlhttp = new ActiveXObject("Microsoft.XMLHTTP");
          } catch (E) {
           xmlhttp = false;
          }
         }
        @end @*/
        if (!xmlhttp && window.XMLHttpRequest) {
                try {
                        xmlhttp = new XMLHttpRequest();
                } catch (e) {
                        xmlhttp = false;
                }
        }
        if (!xmlhttp && window.createRequest) {
                try {
                        xmlhttp = window.createRequest();
                } catch (e) {
                        xmlhttp = false;
                }
        }
        
        return xmlhttp;
} // get XMLHttpRequest object


/*
        Try to determine browser type.
        
        The primary goal here is just to get the real browser type and version
        for IE and Firefox. But b_name and b_version will be populated
regardless
        with whatever the default responses are.
*/
//var isIE = false;
var b_name = navigator.appName;
var b_version = parseFloat(navigator.appVersion);
if (!document.all) {
        // IE chokes on .userAgent
        var FF_version = navigator.userAgent.match(/Firefox\/([\d\.]+)/)[1];
        if (FF_version) {
                b_version = FF_version;
                b_name = 'Firefox';
        }
} // if document.all unavailable
else {
//      isIE = true;
        b_version = navigator.appVersion.match(/MSIE (\d+.\d+)/)[1];
}
//alert("Browser: " + b_name + " v" + b_version);

-- 
Sean P Quinlan <[EMAIL PROTECTED]>
 
_______________________________________________
Boston-pm mailing list
Boston-pm@mail.pm.org
http://mail.pm.org/mailman/listinfo/boston-pm

Reply via email to