PDA

View Full Version : Tab Content Script (v 2.2)



radujit
01-22-2011, 09:25 PM
1) Script Title:
Tab Content Script (v 2.2)
2) Script URL (on DD):
http://www.dynamicdrive.com/dynamicindex17/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

jscheuer1
01-23-2011, 07:09 AM
I don't think that's what you really want to do. But, if it is, the correct syntax is:


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.

radujit
01-24-2011, 11:48 AM
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.

jscheuer1
01-24-2011, 01:28 PM
I think you want:

http://www.dynamicdrive.com/dynamicindex17/ajaxtabscontent/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/dynamicindex18/rssdisplaybox/index.htm