[thelist] ajax tabscontent

Christian Heilmann codepo8 at gmail.com
Mon Jul 10 11:19:47 CDT 2006


> > i'm new in ajax and i've made some pages using http://www.dynamicdrive.com/dynamicindex17/ajaxtabscontent/index.htm
> >
> > the question is... how can i redirect from the otherpage.php to mypage.php (ajaxtabscontent enabled) with specified tab?
> > in the other words, how could i specify the active tab from url href?
>
> First ID all your A Elements that make up the tab, e.g.
>
> <li><a id="One"></a></li>
> <li><a id="Two"></a></li>
> <li><a id="Three"></a></li>
> <li><a id="Four"></a></li>
> <li><a id="Five"></a></li>
>
> Pass the target tab via a Query String, e.g. mypage.php?t=Three
>
> Then within the Javascript, after you have called all the AjaxTabs JS code, look at the Query String "t" and use that value to call the main ajaxtabs function:
>
> var t = [code to get Query String Key "t"]
> var objTab = document.getElementById(t);
> ajaxpage(objTab.getAttribute("href"), objTab.getAttribute("rel"), objTab)
>
> Or something close to that. I haven't tested the above - but it should work.

If that really is the solution then this is one heck of a bad script.
Why should I be forced to use IDs on each tab entry when a simply
counter and comparison would do the trick...


-- 
Chris Heilmann
Book: http://www.beginningjavascript.com
Blog: http://www.wait-till-i.com
Writing: http://icant.co.uk/



More information about the thelist mailing list