Irishjugg
11-11-2008, 04:20 AM
1) Script Title: Ajaxtabs
2) Script URL (on DD): http://www.dynamicdrive.com/dynamicindex17/ajaxtabscontent/index.htm
3) Describe problem:
I have some code from the ajax tabs script from ddrive that I use to dynamically load content into a certain div on my page. When I load content in that div, the new content could contain either forms or links, when they are clicked or submitted, I want to have the results, new pages, or redirected pages (from completed forms) load back into the same exact div they already belong to. The issue I am having is that I cannot make this happen, It looks like I can use ajaxtabs to load them into any other div but the div that is currently in scope.
I am new and pathetic with ajax, mostly because to be honest I haven't taken the time to ACTUALLY learn it, more so I have just been slapping together sample code. I feel like this must be a simple issue to fix, can any of you gurus please give me a hand?
Ill post a bit of sample code here..
The ajax tabs happen as such:
<li class="topbars"><a href="mybuddy.php" rel="inner">My Buddy</a></li>
<li class="topbars"><a href="fshipupdate.php" rel="inner">Friendship Logs</a></li>
Initialized by:
var tabs=new ddajaxtabs("tabbar", "inner")
tabs.setpersist(false)
tabs.setselectedClassTarget("link") //"link" or "linkparent"
tabs.init(5)
into the div called inner, which may have links inside of it. All I want to do is have them show up inside the same div, "inner" but the ajaxtabs script isn't having that.
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:
<!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.
2) Script URL (on DD): http://www.dynamicdrive.com/dynamicindex17/ajaxtabscontent/index.htm
3) Describe problem:
I have some code from the ajax tabs script from ddrive that I use to dynamically load content into a certain div on my page. When I load content in that div, the new content could contain either forms or links, when they are clicked or submitted, I want to have the results, new pages, or redirected pages (from completed forms) load back into the same exact div they already belong to. The issue I am having is that I cannot make this happen, It looks like I can use ajaxtabs to load them into any other div but the div that is currently in scope.
I am new and pathetic with ajax, mostly because to be honest I haven't taken the time to ACTUALLY learn it, more so I have just been slapping together sample code. I feel like this must be a simple issue to fix, can any of you gurus please give me a hand?
Ill post a bit of sample code here..
The ajax tabs happen as such:
<li class="topbars"><a href="mybuddy.php" rel="inner">My Buddy</a></li>
<li class="topbars"><a href="fshipupdate.php" rel="inner">Friendship Logs</a></li>
Initialized by:
var tabs=new ddajaxtabs("tabbar", "inner")
tabs.setpersist(false)
tabs.setselectedClassTarget("link") //"link" or "linkparent"
tabs.init(5)
into the div called inner, which may have links inside of it. All I want to do is have them show up inside the same div, "inner" but the ajaxtabs script isn't having that.
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:
<!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.