GeekInterview.com
+ Reply to Thread
Results 1 to 8 of 8

refresh the page using javascript...

This is a discussion on refresh the page using javascript... within the Web Development forums, part of the category; Using javascript i want to refresh my page every 2 minutes....Is there any function in javascript ? ------------------- suresh...

  1. #1
    psuresh1982 is offline Contributing Member psuresh1982 will become famous soon enough
    Join Date
    Sep 2006
    Location
    bangalore, india
    Answers
    1,016

    refresh the page using javascript...

    Using javascript i want to refresh my page every 2 minutes....Is there any function in javascript ?

    -------------------
    suresh


  2. #2
    TigerElango is offline Junior Member TigerElango is on a distinguished road
    Join Date
    Nov 2006
    Location
    Bangalore
    Answers
    26

    Re: refresh the page using javascript...

    Code:
    function reload()
        {
             window.location.reload();
         }
    this method will reload the page when u call the method.....but not for every two minutes......

    the same situation happened for me also ie...to refresh the page every 30 seconds....my friend gave me a piece of code which refreshes every 30 seconds.....but i didn't tried that.....here is that code...

    Code:
    function refreshPeriodic()
    {
       location.reload();
       timerID=setTimeout("refreshPeriodic()",30000);
    }
    timerID=setTimeout("refreshPeriodic()",30000);

    i think it may be useful for u......

    Last edited by TigerElango; 02-03-2007 at 07:25 AM.

  3. #3
    TigerElango is offline Junior Member TigerElango is on a distinguished road
    Join Date
    Nov 2006
    Location
    Bangalore
    Answers
    26

    Re: refresh the page using javascript...

    Code:
    function refreshPeriodic()
    {
       location.reload();
       timerID=setTimeout("refreshPeriodic()",30000);
    }
    timerID=setTimeout("refreshPeriodic()",30000);
    sorry i don't know why the code is not displayed in the previous reply.........

    Last edited by TigerElango; 02-03-2007 at 07:29 AM.

  4. #4
    psuresh1982 is offline Contributing Member psuresh1982 will become famous soon enough
    Join Date
    Sep 2006
    Location
    bangalore, india
    Answers
    1,016

    Re: refresh the page using javascript...

    hi elango i can't see the code..can you upload it. don't use "script" tag..you just post the function.

    --------------------
    suresh


  5. #5
    TigerElango is offline Junior Member TigerElango is on a distinguished road
    Join Date
    Nov 2006
    Location
    Bangalore
    Answers
    26

    Re: refresh the page using javascript...

    Code:
    function refreshPeriodic()
    {
       location.reload();
       timerID=setTimeout("refreshPeriodic()",30000);
    }
    timerID=setTimeout("refreshPeriodic()",30000);



  6. #6
    suji is offline Expert Member suji is on a distinguished road
    Join Date
    Sep 2005
    Answers
    205

    Re: refresh the page using javascript...

    add this

    PHP Code:
    <meta http-equiv="refresh" content="10" 
    refreshes for every 10 sec


  7. #7
    sarathmr is offline Junior Member sarathmr is on a distinguished road
    Join Date
    Dec 2008
    Answers
    1

    Re: refresh the page using javascript...

    Code:
        function reFres() {
      location.reload(true)
    }
    /* Set the number below to the amount of delay, in milliseconds,
    you want between page reloads: 1 minute = 60000 milliseconds. */
    window.setInterval("reFres()",3000);
    // End -->



  8. #8
    nagasen is offline Junior Member nagasen is on a distinguished road
    Join Date
    Apr 2009
    Location
    chennai
    Answers
    4

    Re: refresh the page using javascript...

    Code:
    function fun(){
    var a=setTimeout(funName(),1000)
    }
    
    
    



    •    Sponsored Ads