PDA

View Full Version : Ajax Tabs Content PHP problem new page



albayco
05-08-2007, 12:10 PM
Hi ajax tab contnet html no problem but php new page open help me please

No speak english sorry

php page

http://www.mavisevdam.com/76/aj/demo.php

HTML page

http://www.mavisevdam.com/76/aj/demo.html

Help me please


<?php


echo"<!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\" lang=\"en\" xml:lang=\"en\">"
. "<head>"
. "<title>Dynamic Drive DHTML Scripts- Ajax Tabs Content script</title>"
. "<link rel=\"stylesheet\" type=\"text/css\" href=\"ajaxtabs/ajaxtabs.css\" />"
. ""
. "<script type=\"text/javascript\" src=\"ajaxtabs/ajaxtabs.js\">"
. ""
. "/***********************************************"
. "* Ajax Tabs Content script- &#169; Dynamic Drive DHTML code library (www.dynamicdrive.com)"
. "* This notice MUST stay intact for legal use"
. "* Visit Dynamic Drive at http://www.dynamicdrive.com/ for full source code"
. "***********************************************/"
. ""
. "</script>"
. "</head>"
. ""
. "<body>"
. ""
. "<p><b>Documentation:</b> <a href=\"http://www.dynamicdrive.com/dynamicindex17/ajaxtabscontent/\">http://www.dynamicdrive.com/dynamicindex17/ajaxtabscontent/</a></p>"
. "<br />"
. ""
. "<ul id=\"maintab\" class=\"shadetabs\">"
. "<li class=\"selected\"><a href=\"#default\" rel=\"ajaxcontentarea\">Intro</a></li>"
. "<li><a href=\"external1.html\" rel=\"ajaxcontentarea\">Poems</a></li>"
. "<li><a href=\"external2.html\" rel=\"ajaxcontentarea\">Downloads</a></li>"
. "<li><a href=\"external3.html\" rel=\"ajaxcontentarea\">Pop Downd</a></li>"
. "<li><a href=\"external4.html\" rel=\"ajaxcontentarea\">Sea Otter</a></li>"
. "</ul>"
. ""
. "<div id=\"ajaxcontentarea\" class=\"contentstyle\">"
. "<p>This is some default tab content, embedded directly inside this space and not via Ajax. It can be shown when no tabs are automatically selected, or associated with a certain tab, in this case, the first tab.</p>"
. "<p><b><a href=\"javascript: expandtab('maintab', 2)\">Select 3rd tab of \"maintab\"</a></b></p>"
. "</div>"
. ""
. "<script type=\"text/javascript\">"
. "//Start Ajax tabs script for UL with id=\"maintab\" Separate multiple ids each with a comma."
. "startajaxtabs(\"maintab\")"
. "</script>"
. ""
. "</body>"
. ""
. "</html>"
."";

?>

tech_support
05-09-2007, 06:18 AM
What?
Can you please describe your problem properly.

albayco
05-09-2007, 11:14 AM
http://www.mavisevdam.com/76/aj/demo.php

click tab pls
tabs open new page

alexjewell
05-09-2007, 09:44 PM
The problem is your links are not linked to the javascript. They're linked directly to the html file for that page. For example:

Change the third tab, Downloads, to link to "javascript: expandtab('maintab', 2)", instead of to "external2.html".

Make sense?

albayco
05-10-2007, 08:25 AM
<?php



echo"<!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\" lang=\"en\" xml:lang=\"en\">"
. "<head>"
. "<title>Dynamic Drive DHTML Scripts- Ajax Tabs Content script</title>"
. "<link rel=\"stylesheet\" type=\"text/css\" href=\"ajaxtabs/ajaxtabs.css\" />"
. ""
. "<script type=\"text/javascript\" src=\"ajaxtabs/ajaxtabs.js\">"
. ""
. "/***********************************************"
. "* Ajax Tabs Content script- &#169; Dynamic Drive DHTML code library (www.dynamicdrive.com)"
. "* This notice MUST stay intact for legal use"
. "* Visit Dynamic Drive at http://www.dynamicdrive.com/ for full source code"
. "***********************************************/"
. ""
. "</script>"
. "</head>"
. ""
. "<body>"
. ""
. "<p><b>Documentation:</b> <a href=\"http://www.dynamicdrive.com/dynamicindex17/ajaxtabscontent/\">http://www.dynamicdrive.com/dynamicindex17/ajaxtabscontent/</a></p>"
. "<br />"
. ""
. "<ul id=\"maintab\" class=\"shadetabs\">"
. "<li class=\"selected\"><a href=\"#default\" rel=\"ajaxcontentarea\">Intro</a></li>"
. "<li><a href=\"javascript: expandtab('maintab', 1)\">a</a></li>"
. "<li><a href=\"javascript: expandtab('maintab', 2)\">b</a></li>"
. "<li><a href=\"javascript: expandtab('maintab', 3)\">c</a></li>"
. "<li><a href=\"javascript: expandtab('maintab', 4)\">d</a></li>"
. "</ul>"
. ""
. "<div id=\"ajaxcontentarea\" class=\"contentstyle\">"
. "<p>This is some default tab content, embedded directly inside this space and not via Ajax. It can be shown when no tabs are automatically selected, or associated with a certain tab, in this case, the first tab.</p>"
. "<p><b>Select 3rd tab of \"maintab\"</b></p>"
. "</div>";
echo"<script type=\"text/javascript\">"
. "if(location.search!=''){"
. "document.getElementById('maintab').getElementsByTagName('li')[0].className=''"
. "document.getElementById('maintab').getElementsByTagName('li')[parseInt(unescape(location.search).replace(/\\D/g, ''))].className=\"selected\""
. "}"
. "//Start Ajax tabs script for UL with id=\"maintab\" Separate multiple ids each with a comma."
. "startajaxtabs(\"maintab\")"
. "</script>"
. "</body>"
. "</html>"
."";

?>

No click Javascript :((

Help please

alexjewell
05-10-2007, 09:08 PM
Hmm. That's the only thing I saw. Are you sure there's no errors with the quotes? Maybe using single quotes instead of double quotes in the PHP would simplify the code a bit more and bring out anymore errors.

worldlee78
06-09-2007, 03:34 AM
I attempted to make my page work using the original code from the Dynamic Drive file at

http://www.dynamicdrive.com/dynamicindex17/ajaxtabscontent/index.htm

What happens is, the entire page loads overtop of the existing page, rather than in the div tags.

Not sure why that is, but any help would be appreciated