nyl-auster
8/14/2012 - 4:00 PM

Ajax popup drupal

Ajax popup drupal

// limit scope fo our variable, and pass Jquery object as "$".
(function ($) {


  Drupal.behaviors.rf_frequence = {
    attach : function (context){
       popup_open(context); 
    }
  }

  function popup_open(context) {

    $('#orgchart-popup').show();

    $('.orgchart-popup-link').click(function(){
      url = $(this).attr('href');
      $.get(url, {http_request_sent_by_ajax : 1}, function(data) {
        $('#orgchart-popup').html(data);
      });
      return false;
    });


  }

})(jQuery);