This is my js script:
<script language="javascript">
setTimeout ( "autoForward()" , 5000 );
function autoForward() {
var submitForm = $("#submitfrm").find("form");
submitForm.submit();
}
</script>
And the error occurs at:
var submitForm = $("#submitfrm").find("form");
I'm using jQuery and I noticed this answer on SO but when I tried to add it:
<script language="javascript">
jQuery(document).ready(function ($) {
setTimeout ( "autoForward()" , 5000 );
function autoForward() {
var submitForm = $("#submitfrm").find("form");
submitForm.submit();
}
});
</script>
I get:
Uncaught ReferenceError: autoForward is not defined
I also tried to switch the function's position but it didn't help. What's wrong here?