javascript - setTimeout() target function never fires -


function redirecthome() {     alert("here1");     function sethref() {         alert("here2");             window.parent.location.href="fprindex.html?action=edit&aspect=<%=request("aspect")%>&id=<%=request("request_id")%>";     };      document.forms["form1"].submit();     var timer = settimeout( sethref, 1000 ); } 

redirecthome() called via button "onclick()" event.

the first alert "here1" seen, "here2" never seen.

what's wrong?

what work if simply:

function redirecthome() {     document.forms["form1"].submit();        window.parent.location.href="fprindex.html?action=edit&aspect=<%=request("aspect")%>&id=<%=request("request_id")%>"; } 

what i'm effect 1 second delay time form submitted, time redirect happens - purely aesthetic reasons.

what problem submit() call causing full post server, similar page refresh , means following javascript not fired.


Comments

Popular posts from this blog

resizing Telegram inline keyboard -

command line - How can a Python program background itself? -

php - "cURL error 28: Resolving timed out" on Wordpress on Azure App Service on Linux -