PDA

View Full Version : Ajax Tabs Content Script - Caching in Firefox



gustel
11-27-2007, 03:16 PM
1) Script Title:
Ajax Tabs Content Script

2) Script URL (on DD):
http://www.dynamicdrive.com/dynamicindex17/ajaxtabscontent/

3) Describe problem:
Hey there,

first of all: thanks a lot for the great work, the script works (almost) perfect!

But I've got one question:
I produce the tabs dynamic out of a database ... no problem so far ... works well.
When I get a url like /index.php/testing/tab1
then I would like to set 'tab1' on page 'testing' as active, no matter in which order the tabs are.

Until now no problems, it took me a while, but it's working.

Here a litte bit of source-code, which inserts the javascript to generate the tabs:


echo "<script type=\"text/javascript\">\n";
echo "<!--\n";
echo "var tabs=new ddajaxtabs(\"tabcontainer\", \"text_tabs\")\n";
echo "tabs.setpersist(false)\n";
echo "tabs.setselectedClassTarget(\"link\")\n";
echo "tabs.init()\n";
echo ($tab["bezeichnung"]!="")?"tabs.expandit('".$tab["bezeichnung"]."')\n":"";
echo "//-->\n";
echo "</script>\n";


That really works great, but when I open a site with tabs in Firefox (actually 2.0.0.10, not tested in other versions yet), with a url like above, it sets the correct tab as active, but the content of the first tab (no matter which one this is) is displayed!!!

Like you see, I set tabs.setpersist to false, it works perfectly in IE, but not in Firefox ...

Do you have any idea on this problem? Thanks in advance for comments!

ddadmin
11-28-2007, 01:38 AM
Please post a link to the page on your site that contains the problematic script so we can check it out.

gustel
11-28-2007, 01:44 PM
http://meyerbeck.flexlogic.info

Sorry, it's german, not english :)

If you go to "Unternehmen - Über uns", it works correctly.
If you go to "Dienstleistungen - Verkauf/Marketing", the problem occurs.

Thanks in advance!

ddadmin
11-29-2007, 01:03 AM
Hmmm looking at your page, I'm not sure I understand the problem. FYI, both "Über uns" and "Verkauf/Marketing" when clicked on causes the 1st tab to be selected, and its corresponding content (I assume). You say you wish to use a URL parameter to indicate to the script which tab to select by default, so I gather instead of just:

http://meyerbeck.flexlogic.info/index.php/dienstleistungen/verkaufmarketing

I should be using a different URL to test out this aspect of your problem?

ddadmin
11-29-2007, 01:06 AM
You may also want to see this thread (http://www.dynamicdrive.com/forums/showthread.php?t=26799), which shows a JavaScript solution for getting a certain tab to be selected by default through URL parameters.

gustel
11-29-2007, 07:28 AM
Thanks a lot for the responses, and the other threads are very interesting ... have to keep them in mind *gg*

But when I tried again today, the problem disapeared ... no idea why?!?!
Probably really something stayed in the cache of Firefox and then showed me the last active tab ... although I deleted everything ... mmmhhhh.

Thanks again and have a nice day!

EDIT: damn ... not really ...
The problem still exists ... after doing it a few times ...
if you go to http://meyerbeck.flexlogic.info/index.php/dienstleistungen/verkaufmarketing then the first tab should be active ... works
if you go to http://meyerbeck.flexlogic.info/index.php/dienstleistungen/verkaufmarketing/seminare then again the first tab should be active ... works too
if you go to http://meyerbeck.flexlogic.info/index.php/dienstleistungen/verkaufmarketing/events then again the third tab should be active ... it is active, but content of tab1 is displayed! tip: workshops and events-tab are empty files, so nothing should be displayed!

The third parameter after index.php/ ... should be the tab to select --> if it is empty, take the first one, if not, expandit