Hello and welcome to our community! Is this your first visit?
Enjoy an ad free experience by logging in. Not a member yet? Register.
Results 1 to 2 of 2
  1. #1
    New to the CF scene
    Join Date
    Jul 2007
    Thanked 0 Times in 0 Posts

    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>
    <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.

  • #2
    Master Coder felgall's Avatar
    Join Date
    Sep 2005
    Sydney, Australia
    Thanked 663 Times in 652 Posts
    The includes will run on the server before thhe page is downloaded for the browser to display. To control what is visible you need to show/hide the contents of the appropriate divs.
    Learn Modern JavaScript - http://javascriptexample.net/
    Helping others to solve their computer problem at http://www.felgall.com/

    Don't forget to start your JavaScript code with "use strict"; which makes it easier to find errors in your code.


    Posting Permissions

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