First, I would check on the notices in the JavaScript console — the dialog-polyfill.js file is 404ing.
Also, try moving your <script></script> from the header to some place below that JavaScript file. (Just above the closing </body> tag should work well.)