on click do this....<? include("unit3.html"); ?>
Hi, all
I have a ajax page which consists of 5 tabs. I used DW widget.
<div id="TabbedPanels1" class="TabbedPanels">
<ul class="TabbedPanelsTabGroup">
<li class="TabbedPanelsTab" tabindex="0">Tab 1</li>
<li class="TabbedPanelsTab" tabindex="0">Tab 2</li>
<li class="TabbedPanelsTab" tabindex="0">Tab 3</li>
</ul>
<div class="TabbedPanelsContentGroup">
<div class="TabbedPanelsContent"><? include("unit1.html"); ?></div>
<div class="TabbedPanelsContent"><? include("unit2.html"); ?></div>
<div class="TabbedPanelsContent"><? include("unit3.html"); ?></div>
</div>
As you can see i sued php inlude command, it icludes all the pages and this makes loading slow. To prevent this i would like my tabs load content when it is clicked.
How can i make my tabs include content when i click it?
Thank you very for the code you'll give.
kb posted this at 09:56 — 5th August 2007.
He has: 1,380 posts
Joined: Feb 2002
Well, spelling things correctly always makes your posts easier to read...
You'll have to use XMLHttpRequest to do that. You can use pre-written libraries like Prototype (http://www.prototypejs.org) to do this.
nolikewise posted this at 10:40 — 5th August 2007.
They have: 5 posts
Joined: Jul 2007
You are right about my spelling, i had to write it urgently. I am sorry for that.
The webpage link you gave did not help me. All i need is to stop my tabs include all the content. ıf i can include them when clicked, there will be no problem.
I am giving whole page, if you could edit and send back i'll be glad. Thank you so much...
<!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" />
<title>Untitled Document</title>
<style type="text/css">
<!--
p.MsoNormal {
margin:0cm;
margin-bottom:.0001pt;
font-size:12.0pt;
font-family:"Times New Roman","serif";
}
-->
</style>
<style type="text/css">
<!--
li.MsoNormal {
margin:0cm;
margin-bottom:.0001pt;
font-size:12.0pt;
font-family:"Times New Roman","serif";
}
-->
</style>
<script src="SpryAssets/SpryTabbedPanels.js" type="text/javascript"></script>
<link href="SpryAssets/SpryTabbedPanels.css" rel="stylesheet" type="text/css" />
</head>
<body>
<div id="TabbedPanels1" class="TabbedPanels">
<ul class="TabbedPanelsTabGroup">
<li class="TabbedPanelsTab" tabindex="0">Tab 1</li>
<li class="TabbedPanelsTab" tabindex="0">Tab 2</li>
<li class="TabbedPanelsTab" tabindex="0">Tab 3</li>
</ul>
<div class="TabbedPanelsContentGroup">
<div class="TabbedPanelsContent"><? include("unit1.html"); ?></div>
<div class="TabbedPanelsContent"><? include("unit2.html"); ?></div>
<div class="TabbedPanelsContent"><? include("unit3.html"); ?></div>
</div>
</div>
<script type="text/javascript">
<!--
var TabbedPanels1 = new Spry.Widget.TabbedPanels("TabbedPanels1");
//-->
</script>
</body>
</html>
i didnt write css and javascript code.
kb posted this at 11:20 — 5th August 2007.
He has: 1,380 posts
Joined: Feb 2002
We aren't going to make your site for you. We will help you figure out how, and help you debug if you get stuck, but it's not our project to do.
That website will help you, if you take the time to read.
If you want to load dynamically, you're going to have to use "AJAX". If you want to load pre-emptively, and just hide until ready, you'll have to use some average-level JS.
Decide which, and I can give you more info.
nolikewise posted this at 12:31 — 5th August 2007.
They have: 5 posts
Joined: Jul 2007
I can understand your opinion and respect, you don't give fish rather teach how to fish. I appreaciate your ideas. I always tried to learn php, but by using explicit methods it is so hard, implicitly it is easier and better. The best way trying and learning from other people. I learnt css by doing so.
Thank you very much, i'll disturb you if i need help...
Thanks for the webpage and help people around...
Want to join the discussion? Create an account or log in if you already have one. Joining is fast, free and painless! We’ll even whisk you back here when you’ve finished.