Last active
October 8, 2015 15:18
-
-
Save yann-yinn/3350488 to your computer and use it in GitHub Desktop.
Ajax popup drupal
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// 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