Skip to content

Instantly share code, notes, and snippets.

@yann-yinn
Last active October 8, 2015 15:18
Show Gist options
  • Save yann-yinn/3350488 to your computer and use it in GitHub Desktop.
Save yann-yinn/3350488 to your computer and use it in GitHub Desktop.
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);
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment