[thelist] ajax tabscontent

Anthony Baratta anthony at baratta.com
Mon Jul 10 10:28: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.




More information about the thelist mailing list