I have a page up, no one will be able to log in (please don't try to break my scripts yet, I havent dealt with that part yet
)
http://web.science.nd.edu/bestbuddies/welcome.php
But I will put a link on the page from the "About" link. By clicking "about" you load the ajax page into the inner div, and my goal is to have you click on the link in there and have it load a new ajax page in the exact same "inner" div.
Also, code for the page with the dummy link is here:
Code:
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<meta http-equiv="Content-Type" content="text/html; charset=UTF-8" />
</head>
<?php
include 'funcs/conn.php';
include 'funcs/pages.php';
?>
<script type="text/javascript">
var headID = document.getElementsByTagName("head")[0];
var newScript = document.createElement('script');
newScript.type = 'text/javascript';
newScript.src = '../js/ajaxtabs/ajaxtabs.js';
headID.appendChild(newScript);
</script>
<body>
<div id="smspacer"></div>
<?php //buddyInfo(1); ?>
<div id="test">
<h3>Under Construction<br /><br /><a href="external.php" rel="inner">This link for programmer debugging only</a></h3>
</div>
<script type="text/javascript">
var tabs3=new ddajaxtabs("test", "inner")
tabs3.setpersist(false)
tabs3.setselectedClassTarget("link") //"link" or "linkparent"
tabs3.init(5)
</script>
</body>
</html>
I am pretty sure the issue has to do with the ajax fetched page not "knowing about" the div named inner which is from the page that fetched the above code.
After Looking thru the documentation for ajaxtabs, I changed my code to the code for nested tabs as shown here:
Code:
var tabs=new ddajaxtabs("tabbar", "inner")
tabs.setpersist(false)
tabs.setselectedClassTarget("link") //"link" or "linkparent"
tabs.init(5)
tabs.onajaxpageload=function(pageurl){
if (pageurl.indexOf("mybuddy.php")!=-1){
tabs3=new ddajaxtabs("test", "inner")
tabs3.setpersist(false)
tabs3.setselectedClassTarget("link") //"link" or "linkparent"
tabs3.init()
If I leave that code in, the page automatically loads whatever page the link that is in the file that ajax fetches as if it had already been clicked. This does not happen if I comment out the tabs3.init(). I feel like this is closer to a solution, and maybe some of the great coders here can help me piece together a solution from this.
Bookmarks