Jump to content

SELECT from DB on tab click [w/ Ajax, maybe]


soltek

Recommended Posts

Hey there, I got a nice tabbed menu made with Jquery where each button/tab shows the user the related content on the atributed div, without any new loading since the whole data was already loaded at once.

 

For example, there is  COLOR tab, and the SATURATION tab. If you click on the saturation tab, it displays above the menu the saturation div:

 

<div id="saturation" class="show">
    <ul>
      <li>1</li>
      <li>2</li>
      <li>3</li>
    </ul>  
  </div>  

 

... and so on.

 

The thing is the data for the tabs content comes from the php file itself, there's no interaction with a database content, and well... that kinda sucks.

 

What I was trying to do was to select the DB data and show it on the divs, BUT only when the user request to see the second tab content (it'd be a waste of bandwith, processor power and user time to load the data from 5 tabs when he doesnt wanna see any of those). I think this can be done with Ajax, so there's no need to reload the entire page over and over.

 

Could you give me a hand, 'cause I'm kinda stuck.

Thank you =)

Link to comment
Share on other sites

This thread is more than a year old. Please don't revive it unless you have something important to add.

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Restore formatting

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.