PDA

View Full Version : Ajax Tabs Content script



daend
04-19-2007, 03:36 PM
1) Script Title: Ajax Tabs Content script

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

3) Describe problem:
Hi,
look first at this page please: http://www.ontheweb.cz/_hotels-europe/
I am trying send country ID from tab One (Countries) in to tab Two (Cities) so I can view only cities which are in selected country. Can any one help me with this? I donít understand Javascript at all and it already took me whole day without any results :-( Thanks.
Petr

ddadmin
04-20-2007, 12:08 PM
I can only talk in generality here, since this is something that involves both the client and server side that only you have access to. But I would imagine what you need to do is modify the function:


function expandtab(tabcontentid, tabnumber, query){ //interface for selecting a tab (plus expand corresponding content)
var thetab=document.getElementById(tabcontentid).getElementsByTagName("a")[tabnumber]
if (thetab.getAttribute("rel")){
var querystr=(typeof query!="undefined")? query : ""
ajaxpage(thetab.getAttribute("href")+querystr, thetab.getAttribute("rel"), thetab)
loadobjs(thetab.getAttribute("rev"))
}
}

With an optional 3rd parameter to pass in a query string, and add it to the URL of the Country Tab to load a different page accordingly. The code in red shows the changes made to the original function.

BTW, please note that your page is currently in violation of our usage terms, since the credit notice doesn't appear inline on the page. Please reinstate the credit notice:

daend
05-29-2007, 05:23 PM
Sorry for really late answer. I just stop working on this for a while and now get back.
Your solution is unfortunately not working. After changing code it stops on loading the page with "Requesting content..." text.

Any sujestiong where can be problem? It is not neccessary to have country ID as a name it can be also number.