It doesn't matter where the flash messages appear in the HTML (thanks to fixed positioning), so why not keep it simple and send them with the main response. preventDefault in case we are inside a form, so the button doesn't submit it.
And updating the secondary button style to ensure it's always white background
They now hover near the bottom of the screen. I've created new variables so as not to mess with the existing use of color-success etc.