console.log("trigger") var modalWeather = document.getElementById("modalWeather") // document.addEventListener('DOMContentLoaded', function() { // $(weatherModal).modal('show') // }, false); // window.onload = function trigger(){ // $(weatherModal).modal('show') // } $(document).ready(function(){ $(modalWeather).modal('show') });