Testcase #1 (1 Popunder, use a function as parameter)

  window.fPopunder = function(event) {
      if (!window.fPopunderStack) {
          window.fPopunderStack = [
              ['https://www.bing.com']
          ];
      }

      return window.fPopunderStack;
  };

  $.popunder(window.fPopunder, '#testFormOne', '#testFormOne input[type="submit"]');

Testcase #2 (3 Popunder)

                window.aThreePopunder = [
                    ['https://www.github.com', {window: {height:400, width:400}, blocktime: 1}],
                    ['https://www.bing.com', {window: {height:100, width:100}, cb: function() {
                        console.log('bing.com has been opened');
                    }}],
                    ['https://www.google.com']
                ];

                $.popunder(window.aThreePopunder, '#testFormTwo', '#testFormTwo input[type="submit"], #testFormTwo a');
            
Open Popunder via Link

Testcase #3 (1 Popunder)

                window.aPopunder = [
                    ['https://www.bing.com']
                ];
            
Open Popunder via Link

Testcase #4 (1 Popunder, use a function as parameter - form with target="_blank")

                window.fPopunder = function(event) {
                    if (!window.fPopunderStack) {
                        window.fPopunderStack = [
                            ['https://www.bing.com', {window: {height:100, width:100}, cb: function(popunderWindow) {
                                console.log('google.com has been opened', popunderWindow);
                            }}]
                        ];
                    }

                    return window.fPopunderStack;
                };

                $.popunder(window.fPopunder, '#testFormFour', '#testFormFour input[type="submit"]');
            

Testcase #5 (1 Popunder, use a function as parameter and check for enabled checkboxes)

                window.fPopunder = function(event) {
                    if (!window.fPopunderStack) {
                        var $checkboxes = $(event.target).parent('form').eq(0).find('input[type="checkbox"]:checked'),
                            stack = [];
                        $.each($checkboxes, function(i, d) {
                            stack.push([$(d).val()]);
                        });
                        window.fPopunderStack = stack;
                    }

                    return window.fPopunderStack;
                };

                $.popunder(window.fPopunder, '#testFormFive', '#testFormFive input[type="submit"]');
            

Open Popunder via Link

Example #6 (unbind a popunder)

                window.fPopunder = function(event) {
                    if (!window.fPopunderStack) {
                        window.fPopunderStack = [
                            ['https://www.github.com']
                        ];
                    }

                    return window.fPopunderStack;
                };

                $.popunder(window.fPopunder, '#testFormSix', '#testFormSix input[type="submit"]');
            
Unbind popunder Show Button