[Cartoweb-users] Refreshing from another url

oliver oliver.christen at camptocamp.com
Mon Apr 24 03:19:28 EDT 2006


Hi Raihan,
Thats exactly what the piece of script i sent is used to.
Run that function on the opener side when you open the new windows. When the new windows is closed, the try() will fail hence the new window is closed, then simply refresh or reset the opener side. (Replace //do action by resetSession (); in the script).

This is the only way i found to handle cross domain window action.

Regards


  ----- Original Message ----- 
  From: Hasan A. Raihan 
  To: oliver 
  Sent: Monday, April 24, 2006 9:09 AM
  Subject: Re: [Cartoweb-users] Refreshing from another url


  Oliver,

  Thanks for fast replying.

  But I like to refresh the opener(cartoweb) page when closing the 
  opened(popup) page. 

  Something like the following code in the onclick event of close button of the popup.

  window.opener.location.reload();
  self.close();


  Raihan
  ----- Original Message ----- 

    From: oliver 
    To: Hasan A. Raihan ; Cartoweb-users at lists.maptools.org 
    Sent: Monday, April 24, 2006 12:22 PM
    Subject: Re: [Cartoweb-users] Refreshing from another url


    One solution is to have a javascript function on the opener side that check, say, every 5 sec, if the opened page is still open. 
    something like:

    function isopenCheck () {
      var delay = 5000;
      timerID = self.setTimeout("checkOpen()", delay);
    }
    function checkOpen() {
      if (window.name_of_the_opened_window && window.name_of_the_opened_window.open && !window.name_of_the_opened_window.closed) {
          try {
            name_of_the_opened_window.location.href
          } catch (e) {
            // if error, then cant access property, hence, domain changed
            //do action
          }
      } else {
        // do other action
        return;
      }
    }

    this will only work if you open the external page via a windows.open javascript function, but it should do the trick

    Regards
    Oliver
      ----- Original Message ----- 
      From: Hasan A. Raihan 
      To: Cartoweb-users at lists.maptools.org 
      Sent: Monday, April 24, 2006 7:23 AM
      Subject: [Cartoweb-users] Refreshing from another url


      Hi list,

      I have a plugin, that invoke a page from different domain.
      Now I need to refresh the map when the opened page close.
      The window.opener.location.reload() function doesnot work because
      the popup is in different domain.

      Do I have any other option to do that?

      Best Regards,

      Hasan A. Raihan
      System Analyst
      ERP Systems Limited
      17/C (2nd Floor), Monipuripara 
      Dhaka - 1215, Bangladesh.
      Tel: 9131551
      Email: h_raihan at erp-bd.com 


--------------------------------------------------------------------------


      _______________________________________________
      Cartoweb-users mailing list
      Cartoweb-users at lists.maptools.org
      http://lists.maptools.org/mailman/listinfo/cartoweb-users
-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://lists.maptools.org/pipermail/cartoweb-users/attachments/20060424/9189b13d/attachment.html


More information about the Cartoweb-users mailing list