Page auto reload with parameters

前端 未结 3 663
一个人的身影
一个人的身影 2020-12-20 00:30

I am trying to autoreload my page after every 20 seconds. I am using JavaScript for this instead of the .

I have and here is

相关标签:
3条回答
  • 2020-12-20 00:50

    window.location will include the GET parameters that were that was passed.

    function SetTimer(){ 
        setTimeout('window.location.replace(window.location)', 20000)
    }
    

    If you are submitting parameters through POST, the best method will probably be to create a form with hidden inputs for each parameter. Submit the form every twenty seconds.

    0 讨论(0)
  • 2020-12-20 00:52
     setTimeout('window.location.replace(window.location.href)', 2000);
    

    did the trick

    0 讨论(0)
  • 2020-12-20 00:53

    Simple page reload also does a trick

    function SetTimer(){ 
        setTimeout('window.location.reload(true)', 20000)
    }
    
    0 讨论(0)
提交回复
热议问题