I have an href that I want to be clicked automatically on page load. This is the HTML:
<a href="http://www.google.com" id="foo">YahOO</a>
and this is the script part:
<script src="https://ajax.googleapis.com/ajax/libs/jquery/1.11.3/jquery.min.js"></script>
<script type="text/javascript">
$(document).ready(function() {
$("#foo").trigger('click');
});
</script>
But when I load the page nothing happens. Am I using the wrong ajax lib or what is wrong with this code?