...

View Full Version : Link Target for Ajax Tabs



johnwboyd
08-31-2011, 10:10 PM
I have an ajax tabbed site which loads the content in the div below it.

I made a drop down link so that the user could select one of 3 on one tab but this is outside of the script.js. I'm wondering if there's a way to get the target of these drop down links to open in the div below instead of a new tab?

http://voiceprocess.net/script.js

<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
<title>Home Improvement Survey Process</title>
<link href="../../../voiceprocess.ico" rel="shortcut Icon">
<link rel="stylesheet" type="text/css" href="../styles.css" />
<link href="../dropdown.css" rel="stylesheet" type="text/css" />
<script type="text/javascript" src="jquery.min.js"></script>
<script type="text/javascript" src="script.js"></script>

</head>

<body>

<div id="main" style="float:left">

<table width="991" border="0" cellpadding="0">
<tr>
<td width="649"><ul class="tabContainer">
<!-- The jQuery generated tabs go here -->
</ul></td>
<td width="75" style="padding-bottom:43px"> <div id="centeredmenu" style=" width:0px; height:0px"> <ul > <li style="padding-left:0px"><span class="sears"><a href="#')">&nbsp;</a></span>
<ul style="padding-top:2px"> <span class="space"></span><span class="space"></span>
<li><a href="pages/sears_refacing.html" target="_self">Cabinets Refacing</a> <div>
<li><a href="pages/sears_hvac.html">HVAC </a></li>
<li><a href="pages/sears_windows.html"></a>New Windows </a></li>
</ul>
</li>
</div></td>
<td width="241"><a href="upsell.php" target="_blank"><img src="../u.png" alt="" width="26" height="37" border="0" style="padding-bottom:5px"/></a>&nbsp;<a href="../data.html" target="_blank"><img src="../s.png" alt="" width="29" height="37" border="0" style="padding-bottom:5px"/></a><img src="../../../images/logosm.png" alt="" width="158" height="42" hspace="10" /> </td>
</tr>
</table>
<div id="tabContent">
<div id="contentHolder">
<!-- The AJAX fetched content goes here -->
</div>
</div>
</body>
</html>

Old Pedant
09-01-2011, 12:41 AM
Not to ask a silly question...

Why do people use AJAX to get *static* tab content??

I can understand using AJAX if your tab content is partly from a database (i.e., if you are using PHP or ASP or JSP pages to get the content), but when the content is just an HTML file????

Why not simply load up *all* the tabs when the page first loads and then simply switch one is showing? *SO* much simpler. And likely faster, in the long run. Certainly a lighter server load.

Old Pedant
09-01-2011, 12:47 AM
So you are saying you want these links:


<li><a href="pages/sears_refacing.html" rel="nofollow" target="_self">Cabinets Refacing</a> <div>
<li><a href="pages/sears_hvac.html">HVAC </a></li>
<li><a href="pages/sears_windows.html"></a>New Windows </a></li>

to open in the *same* <div id="contentHolder"> as do the tabbed links?

Incidentally, your HTML there is illegal.

The <div> should be </li>.

The red </a> is bogus and extra.

johnwboyd
09-01-2011, 03:19 AM
So you are saying you want these links:
Code:

<li><a href="pages/sears_refacing.html" rel="nofollow" target="_self">Cabinets Refacing</a> <div>
<li><a href="pages/sears_hvac.html">HVAC </a></li>
<li><a href="pages/sears_windows.html"></a>New Windows </a></li>

to open in the *same* <div id="contentHolder"> as do the tabbed links?

YES. Thank you!

johnwboyd
09-01-2011, 03:20 AM
So you are saying you want these links:
Code:

<li><a href="pages/sears_refacing.html" rel="nofollow" target="_self">Cabinets Refacing</a> <div>
<li><a href="pages/sears_hvac.html">HVAC </a></li>
<li><a href="pages/sears_windows.html"></a>New Windows </a></li>

to open in the *same* <div id="contentHolder"> as do the tabbed links?

YES. Thank you!


This forum is not allowing me to thank or reply per poster it seems... :(

P.S. there it is now and I can't delete this post. Dohh.

johnwboyd
09-01-2011, 03:22 AM
Do you suggest a 2 frame layout?

Old Pedant
09-01-2011, 04:49 AM
You mean an <iframe>? How does that get the content specified by your add-on menu into the *SAME* <div> as the AJAX tabs???

I started to give this a try, but I don't use jQuery and I think I would have made it way overly complex. If you don't get an answer soon, ask in the jQuery forum.

johnwboyd
09-02-2011, 11:42 AM
You mean an <iframe>? How does that get the content specified by your add-on menu into the *SAME* <div> as the AJAX tabs???

I started to give this a try, but I don't use jQuery and I think I would have made it way overly complex. If you don't get an answer soon, ask in the jQuery forum.

Yeah I guess ur right. I'm just going to redo in basic ajax tabs.



EZ Archive Ads Plugin for vBulletin Copyright 2006 Computer Help Forum