Loading ...
Sorry, an error occurred while loading the content.

Overlibmws , Prototype and AJAX

Expand Messages
  • Erich C. Beyrent
    Hi all, I am trying to use overlibmws to display a popup div which contains the result of an AJAX request via the Prototype library. Using some code that Fote
    Message 1 of 1 , Jun 20, 2006
    • 0 Attachment

      Hi all,

       

      I am trying to use overlibmws to display a popup div which contains the result of an AJAX request via the Prototype library.  Using some code that Fote helped me with during a Google Maps project, I am doing the following:

       

      <a name="unitProfile" id="unitProfile" href="javascript:void(0);"

      onClick="overlib(myGMdiv, TEXTPADDING,6, CAPTION,'View Unit Profile',

      STICKY, WIDTH,400, BASE,2, REF,'unitProfile', REFC,'UR', REFP,'LL', REFX,-500, REFY,300,

      FGCOLOR,'#ffffcc', BGCOLOR,'#333399', CGCOLOR,'#336699', CLOSECOLOR,'#ffccff',

      DRAGGABLE, SHADOW, SHADOWX,10, SHADOWY,10, STATUS,'View Unit Profile'); getUnitProfile('profile',’1234', ‘5678’'); return false;"><b>View Unit Profile</b></a>

       

      And the relevant javascript:

       

      var strURL = 'http://' + location.hostname + '/php/ajaxHandler.php';

      var myGMdiv = '<div id="profile" style="width:500px;height:400px;">'

                  + '<strong>Loading...<\/strong><\/div>';

       

      function getUnitProfile(GMid, intResortID, intInventoryID)

      {

        var o = OLgetRef(GMid);

        if(!o)

        {

          cClick();

          return;

        }

        // Define the GET query string parameters

        var params = 'function=getUnitProfile&resortID=' + intResortID + '&inventoryID=' + intInventoryID;

        try

        {

          // Create a new instance of the Ajax object, and send out the request

          var myAjax = new Ajax.Request(strURL,

                                                      {method:'get',

                                                       parameters: params,

                                                       onComplete: function(request)

                                                                              {

                                                                              o.innerHTML = request.requestText;

                                                                               },                                                                                                                                                                    

                                                                               onException: function(req,exception)

                                                                                {

                                                                              alert("The request had a fatal exception thrown.\n\n" + exception);

                                                                              return true;

                                                                                },

                                                                               onFailure: function(request)

                                                                              {

                                                                              return reloadPage();

                                                                              }

                                                      }

                                                      );

                  }

                  catch(Exception)

                  {          

                              alert("Exception detected: " + Exception);

                  }

      }

       

       

      So, what happens is the popup div is created, but when I try to use

       

      var o = OLgetRef(GMid);

       

      it has no properties.  I am sure that I have missed something basic, but I am not sure what.  The url to see this in action is:

       

      http://65.175.198.29/resort15-53-1577.html

       

      Click where it says “View Unit Profile”

       

      Any ideas?

       

      -Erich-

    Your message has been successfully submitted and would be delivered to recipients shortly.