PDA

View Full Version : Link to a page must be in same content



roediej
12-06-2009, 09:05 AM
1) Script Title:
Ajax Tabs Content Script (v 2.2)
2) Script URL (on DD):
http://www.dynamicdrive.com/dynamicindex17/ajaxtabscontent/index.htm
3) Describe problem:

i have included the ajax tabs on my webpage:
http://www.wirdumonline.nl/vier/

i want to load links in the same content.

i can't figure it out how :(

doesn't work:
http://www.wirdumonline.nl/vier/fotos.php?flowertabs=1
<a href="fotos.php?tabinterfaceid=content">Target Page</a>
<a href="javascript: countries.loadajaxpage('fotos.php')">fotos</a></p>

jscheuer1
12-06-2009, 09:42 AM
There is no javascript on photos.php, so the query string cannot be used for anything with Ajax Tabs Content Script (v 2.2).

This syntax:



<a href="javascript: countries.loadajaxpage('fotos.php')">fotos</a>

can work, but it needs to be somewhere that it can access the Ajax Tabs Content Script (either on the 'top' page with the script, or in a page loaded into the 'top' page with the script. And the fotos.php page must be in the same folder as the 'top' page. The countries tabs must be defined on the 'top' page.

If you are using your index.php page as the top page, as appears to be the case, where you have:


<script type="text/javascript">

var myflowers=new ddajaxtabs("flowertabs", "flowerdivcontainer")
myflowers.setpersist(true)
myflowers.setselectedClassTarget("link") //"link" or "linkparent"
myflowers.init()
instance.loadajaxpage(pageurl)
</script>

on index.php, the highlighted part is an error. Your instance is myflowers and pageurl needs to be replaced by an actual quoted page. So, to work, it should be something like:


myflowers.loadajaxpage("wirdum.php");

Or if you don't need that or something like it there, just get rid of that line.

Now, let's say you load in fotos.php by clicking on the:


<li><a href="fotos.php" rel="flowerdivcontainer" >Foto's</a></li>


tab. That will bring in:


<html>
<head>

</head>

<body>
Fotos
</body>
</html>

So you will see:

Fotos

Let's say you want to have a link on fotos.php so that once it has been brought into index.php it can bring in wirdum.php to index.php, make fotos.php look like so:


<html>
<head>

</head>

<body>
Fotos<br>
<a href="javascript: myflowers.loadajaxpage('wirdum.php')">Wirdum</a>
</body>
</html>

roediej
12-06-2009, 10:55 AM
Very good explanation, jscheuer1. it works like that ! I'm happy now ! The problem was indeed the myflowers.loadajaxpage.

many thanks for the fast reply. No i can go further :)