PDA

View Full Version : OnClick select a tab and then load external page



katutxakur
04-02-2009, 09:35 AM
1) Script Title: Ajax Tabs Content

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

3) Describe problem:

Hi,

I have a link like this: <a href="karrantza.html" onClick="pruebas.expandit(1);pruebas.loadajaxpage('karrantza.html');map.setCenter(new GLatLng(43.21168197765769, -3.3956336975097656), 13);return false;">Ver información</a>

I first want to select the 2nd tab and then load there an external page.

The problem is sometimes it first loads the page and then expands the tab, maybe it's because they are asynchronous functions. I don't know.

This is my website: www.euskadi.comze.com

ddadmin
04-02-2009, 10:51 PM
The delay should be negligible, since the time it takes to select a tab should be virtually instantaneous, matching the minimum time it takes to load the associated Ajax page using loadajaxpage(). Testing your page out in FF3.x, I don't really see much of an issue.

katutxakur
04-03-2009, 08:08 AM
Thanks for the answer ddadmin.

That issue happened much often when I had something like this:



pruebas.onajaxpageload=function(pageurl)
{
if (pageurl.indexOf("rallyes.html")!=-1)
{
map.setCenter(new GLatLng(43.02134110532715, -2.6292703247070312), 9);
}
}

Maybe it was because map.setCenter() needs more time than loadajaxpage(). Anyway, I think i won't use this code.

Now I have another question concerning nested tabs, but I'll open a new thread, thanks.