Results 1 to 4 of 4

Thread: Tab Content Script (v 2.2)

  1. #1
    Join Date
    Sep 2010
    Posts
    10
    Thanks
    1
    Thanked 0 Times in 0 Posts

    Default Tab Content Script (v 2.2)

    1) Script Title:
    Tab Content Script (v 2.2)
    2) Script URL (on DD):
    http://www.dynamicdrive.com/dynamici...tabcontent.htm
    3) Describe problem:
    How can I refresh tab contens every x seconds?
    While looking in the forum I found that this can be done by using expandtab function. I tried to use it, however I get the object not found error.
    The address of the page:
    http://www.iisconsult.ro/forexz.asp
    Last edited by radujit; 01-22-2011 at 09:55 PM.

  2. #2
    Join Date
    Mar 2005
    Location
    SE PA USA
    Posts
    30,495
    Thanks
    82
    Thanked 3,449 Times in 3,410 Posts
    Blog Entries
    12

    Default

    I don't think that's what you really want to do. But, if it is, the correct syntax is:

    Code:
    setInterval(function(){countries.expandit(1);}, 3000)
    The reason I don't think you want this is that what it does is every 3 seconds it selects the 2nd tab.

    Notes: The name of the public function is expandit, not expandtab (that one's internal) and the syntax requires it to be a property of the instance - in this case of countries. The tab indexes are numbered form 0, so 1 is the second tab. Using 2 as you had - if it had worked, wouldn't because there are only two tabs, and 2 would be the third tab. There is no third tab.
    Last edited by jscheuer1; 01-23-2011 at 07:18 AM. Reason: precision
    - John
    ________________________

    Show Additional Thanks: International Rescue Committee - Donate or: The Ocean Conservancy - Donate or: PayPal - Donate

  3. #3
    Join Date
    Sep 2010
    Posts
    10
    Thanks
    1
    Thanked 0 Times in 0 Posts

    Default

    Thank you for your answer.
    Actually, that's not what I want to do.
    In both tabs "Piata valutara" si "Marfuri", there is information that is gathered from third parties using xml technology. The data changes every 10 seconds and what I want to do is that information in "Marfuri" and "Piata valutara" to refresh every 10 seconds.

  4. #4
    Join Date
    Mar 2005
    Location
    SE PA USA
    Posts
    30,495
    Thanks
    82
    Thanked 3,449 Times in 3,410 Posts
    Blog Entries
    12

    Default

    I think you want:

    http://www.dynamicdrive.com/dynamici...tent/index.htm

    By default it doesn't cache the page(s) retrieved. You would have to setup an interval each time a tab is selected, probably using the instance.onajaxpageload method. You also want to clear any interval already set. It's a little complicated.

    But you could simply have the page refresh every 3 seconds. That way, if persistence is set, it will have the same effect, except your entire page would have to refresh.

    You could even do that with the current script, if you could be assured that the XML content wouldn't be cached.

    If you want to use Ajax Tabs, get the script up and displaying what you want first. Then let me have a look at it.

    Oh, and if this is an RSS XML feed, you may want want to look into a server side processing, like:

    http://www.dynamicdrive.com/dynamici...ybox/index.htm
    - John
    ________________________

    Show Additional Thanks: International Rescue Committee - Donate or: The Ocean Conservancy - Donate or: PayPal - Donate

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
  •