Results 1 to 6 of 6

Thread: Refresh the Ajax Tabs Content

  1. #1
    Join Date
    Dec 2006
    Posts
    2
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Default Refresh the Ajax Tabs Content

    1) Script Title: Ajax Tabs Content script

    2) Script URL (on DD): http://www.dynamicdrive.com/dynamici...axtabscontent/

    3) Describe problem:
    Hi i have download this script, i have a request/problem, there's a method to refresh the TAB?
    I have on the Tab, the status of user online of a chat (the content of tab is asp), and i want to refresh every 1 or 2 minutes or when a user entry to chat.
    It's possible?
    Thaks so Much

  2. #2
    Join Date
    May 2007
    Posts
    3
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Default

    I too would like to know the answer to this.

  3. #3
    Join Date
    Jun 2007
    Posts
    1
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Default

    I've been trying to do the same thing. I can refresh the tab contents by setting rev= in each tab to a script that does this:

    var seconds = 10; // seconds to wait before refreshing
    var timerId = 0;

    onload = function(){
    timerId = setInterval('location.reload(true)', seconds*1000);
    }

    However, if I click on a tab that's not the default one (class="selected"), it will refresh back to the default one. I tried adding onunload(clearInterval(timerId)) to the above script, but that doesn't work.

    I also tried to do this inside the ajaxtabs script (the first line was original to the script, the setInterval is my addition) after removing the rev= references above, but no refreshing happens:
    loadpage(page_request, containerid);
    setInterval('loadpage(page_request, containerid)', 10000);

    Any ideas?

  4. #4
    Join Date
    Aug 2004
    Posts
    10,143
    Thanks
    3
    Thanked 1,008 Times in 993 Posts
    Blog Entries
    16

    Default

    The built in function:

    Code:
    expandtab('maintab', 2)
    lets you select a particular tab and its content when called, in this case, the second tab. So to refresh a tab periodically, you can do something like:

    Code:
    setInterval(function(){expandtab('maintab', 2)}, 3000)
    This would refresh the second tab every 3 seconds.

  5. #5
    Join Date
    Feb 2009
    Posts
    1
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Default

    Could you please explain how to implement that code to automatically refresh tabs?

  6. #6
    Join Date
    Aug 2004
    Posts
    10,143
    Thanks
    3
    Thanked 1,008 Times in 993 Posts
    Blog Entries
    16

    Default

    You'll have to be more specific willsko87. The code above already will automatically refresh a particular tab every x seconds.
    DD Admin

Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •