window.location - Can't redirect on the same page after closing modal (Bootstrap 4) -


i'm having one-page website. have modal using bootstrap 4. want button close modal , redirect contact section on page. can't figure out why window.location won't work. if try on website (like google) work, not section on same page. url changes page still stays on same location.

my button in modal:

<a data-dismiss="modal" class="btn btn-xl">get free samples</a> 

my javascript code:

$('.modal').on("hidden.bs.modal", function () {          window.location = '#contact';         }     }); 


Comments

Popular posts from this blog

php - Embed BBCode within itself not working -

three.js - how to load gltf in three JS -

sql server - T-SQL: Access DB objects in same schema without qualifying? -