So, I am working on a <canvas>
game which is created and presented inside a bootstrap modal. I am trying to write a javascript function that will be called on gameOver that will present a new (stacked) modal on top of my canvas with 3 buttons for score submission/registration/replay.
I present my first modal by data-toggle
inside my html and works fine, but when I try to present my second modal on top (by javascript) it appears to be reported as not defined.
Here is my code: JSFiddle .
(in this case I call my second modal in my canvas draw method as an example, but I have also tried a separate button, other event listeners etc. The problem is always the same) .
If there is a better way to present that Game Over screen with buttons I'm open to suggestions. I want to avoid drawing any buttons in my canvas though and getting coordinates to read clicks on it.
Thanks in advance.