How do I attach multiple functions with jQuery Ajax content?
I've got a bunch of functions defined in an external js file like so:
- function tabs() {
- $(".tabs").tabs();
- }
-
- function closeOverlay() {
- $(document).on('click','.close',function(event) {
- $(".overlay").fadeOut();
- });
- }
I'm using ajax to load content into my template, and need to load these functions along with it. This loads my content and my tabs function just fine:
- $(document).on('click','#invite',function(event) {
- $(".overlay").fadeIn();
- $(".overlay").load("inc/invite-guests.htm",tabs);
- });
But I can't figure out the syntax to load both my tabs function, and my closeOverlay function at the same time. I thought something like this would work, but it doesn't:
- $(".overlay").load("inc/invite-guests.htm",tabs,closeOverlay);