Results 1 to 7 of 7

Thread: Ajax Tabs Content PHP problem new page

  1. #1
    Join Date
    May 2007
    Posts
    6
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Default Ajax Tabs Content PHP problem new page

    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 Code:
    <?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- © 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>"
     
    ."";

    ?>

  2. #2
    Join Date
    May 2006
    Location
    Sydney, Australia - Near the coast.
    Posts
    1,995
    Thanks
    0
    Thanked 8 Times in 7 Posts

    Default

    What?
    Can you please describe your problem properly.
    Peter - alotofstuffhere[dot]com - Email Me - Donate via PayPal - Got spare hardware? Donate 'em to me :) Just send me a PM.
    Currently: enjoying the early holidays :)
    Read before posting: FAQ | What you CAN'T do with JavaScript | Form Rules | Thread Title Naming Guide

  3. #3
    Join Date
    May 2007
    Posts
    6
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Default

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

    click tab pls
    tabs open new page

  4. #4
    Join Date
    Mar 2006
    Location
    Cleveland, Ohio
    Posts
    574
    Thanks
    6
    Thanked 5 Times in 5 Posts

    Default

    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?
    Thou com'st in such a questionable shape
    Hamlet, Act 1, Scene 4

  5. #5
    Join Date
    May 2007
    Posts
    6
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Default

    Code:
    <?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

  6. #6
    Join Date
    Mar 2006
    Location
    Cleveland, Ohio
    Posts
    574
    Thanks
    6
    Thanked 5 Times in 5 Posts

    Default

    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.
    Thou com'st in such a questionable shape
    Hamlet, Act 1, Scene 4

  7. #7
    Join Date
    Jun 2007
    Posts
    1
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Default I think I understand

    I attempted to make my page work using the original code from the Dynamic Drive file at

    http://www.dynamicdrive.com/dynamici...tent/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

Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •