Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • Home
  • SEARCH
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 129781
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 11, 20262026-05-11T05:50:39+00:00 2026-05-11T05:50:39+00:00

I am relatively new to jQuery and web development. I am using jQuery UI

  • 0

I am relatively new to jQuery and web development.

I am using jQuery UI Tabs to create tabs.

But I want the contents to be loaded only when I select a particular tab.

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. 2026-05-11T05:50:39+00:00Added an answer on May 11, 2026 at 5:50 am

    OK, I assume when the user clicks a tab, you intend to fetch content dynamically, via AJAX. This really involves two things, setting an onclick even for your tab and fetching the data via ajax.

    Setting an onclick event

    Give your tab an class, for example my_tab. Let’s say that when the user clicks the tab you want the handle_tab_click() function to fire. Here’s an example of binding the onclick event to your my_tab tab:

    $('.my_tab').bind('click', handle_tab_click); 

    Your handle_tab_click() function will be given an event argument which will be able to provide you with information on the element that fired the event (in this case, the element with class name my_tab).

    function (event) {     if ($(event.target).hasClass('my_tab')) { /* handle tab click */ }     if ($(event.target).hasClass('my_tab_2')) { /* a different tab click */ }     if ($(event.target).hasClass('my_tab_3')) { /* ... */ } } 

    See the JQuery event documentation for more details here.

    Fetching the data via ajax

    Fetching data will require you to invoke a remote script while supplying information about which tab was clicked (in order to fetch the appropriate information). In the following snippet, we’re invoking the remote script myscript.php, supplying the HTTP GET argument tab_clicked=my_tab and calling the function tab_fetch_cb when the script returns. The final parameter is the type of data being returned (it’s up to you to choose).

    $.get('myscript.php', {tab_clicked, 'my_tab'}, tab_fetch_cb, 'text/json/xml') 

    It’s up to you to design myscript.php to handle the tab_clicked parameter, fetch the appropriate data and return it (i.e. write it back out to the client).

    Here’s an example for tab_fetch_cb:

    function tab_fetch_cb(data, status) {     // populate your newly opened tab with information      // returned from myscript.php here } 

    You can read more about the JQuery get function here, and JQuery ajax functions here

    I’m sorry I can’t be more specific in my examples, but a lot of the processing is really dependant on your task. As it looks as it has already been pointed out, you may look to some JQuery plugins for a canned solution to your problem. That being said, it never hurts to learn how to do this stuff manually w/ JQuery.

    Good luck.

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Ask A Question

Stats

  • Questions 194k
  • Answers 194k
  • Best Answers 0
  • User 1
  • Popular
  • Answers
  • Editorial Team

    How to approach applying for a job at a company ...

    • 7 Answers
  • Editorial Team

    What is a programmer’s life like?

    • 5 Answers
  • Editorial Team

    How to handle personal stress caused by utterly incompetent and ...

    • 5 Answers
  • Editorial Team
    Editorial Team added an answer Look at foo.add(BigInteger.ONE); Does this update foo? Or does it… May 12, 2026 at 6:48 pm
  • Editorial Team
    Editorial Team added an answer The framework will not allow you to change the settings… May 12, 2026 at 6:48 pm
  • Editorial Team
    Editorial Team added an answer Make sure you #import <QuartzCore/QuartzCore.h> into your header or implementation… May 12, 2026 at 6:48 pm

Related Questions

Now that RC1 is out I need to decide once and for all whether
I have a web page with an iframe in it (I don't like it,
I am relatively new to jQuery, and I would like to be able to
I am relatively new to using jQuery and would like to use the load

Trending Tags

analytics british company computer developers django employee employer english facebook french google interview javascript language life php programmer programs salary

Top Members

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.