Quantcast
Channel: WordPress.org Forums » [Header Footer Code Manager] Support
Viewing all articles
Browse latest Browse all 38

Javascript won’t trigger

$
0
0

Replies: 3

Do you know why my javacript doesn’t trigger when i add it to the header of my page? It appear normaly in the source code and work in a local environment (or in a html environement), by in my server with WordPress it’s block by something. Thanks for your help.

<script src="https://ajax.googleapis.com/ajax/libs/jquery/3.5.1/jquery.min.js"></script>
<script type="text/javascript">
$(document).ready(function(){$('#click').click(function(){
window.location.href = 'https://MyURL.com';});
setTimeout(function(){$('#click').trigger('click');}, 2000);});</script>

Viewing all articles
Browse latest Browse all 38

Trending Articles