I am having problems with event jQuery events on a popup window.
In my main window I have a div acting as a window/dialog that has varying content. I have a button to 'pop out' the 'window' into a popout, allowing users with multiple screens to use my app across them.
How it works, is when the button is pressed, a popup opens with the destination of 'popout.html', onload 'popout.html' calls a function to grab the contents of the div from the main page and place it into the popout. so the content dissapears from the main window and appears in the popup.
That is all working fine, Except any event handler I attach with jQuery like $('<button>Do Something</button>').on('click', console.log).appendTo(newBoxContent); still gets executed on the main window, not the popup. How do I move all these events?