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 7839051
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 2, 20262026-06-02T15:18:26+00:00 2026-06-02T15:18:26+00:00

I have built a jquery tab that shows or hides the tab button if

  • 0

I have built a jquery tab that shows or hides the tab button if its content is empty or not.

Now, because of the pageload, I would like to only load the content when someone clicks on the tab button.

This is the code to check if there is content or not, and hide the tab if empty:

$j(function() {
    if ($j.trim( $j("#CONTENTDIV").html()) == "") {
        $j("li#TABBUTTON").hide();
    }
});

How do I make this load the content when clicked, but hide the tab button if it has no content?

  • 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. Editorial Team
    Editorial Team
    2026-06-02T15:18:30+00:00Added an answer on June 2, 2026 at 3:18 pm

    If you want to delay loading the contents of the tab until it is clicked, then you cannot know (prior to clicking) whether or not the tab should be shown (has content) or not (has none).

    Philosophically, you could create a lightweight, AJAX function that requests an (essentially) empty page that simply asks for whether there is any value in a database field and simply return true if there is any content — not the whole page. Then, on click, you could retrieve the contents.

    Edit: This assumes, of course, that you can detect some value without retrieving the whole page.

    Even if the request for the resources has to retrieve the whole amount, I believe the server should be able to access the resources more quickly than it would take to deliver the content to the user — particularly if the resources reside on the same server that is doing the checking. Regardless, since it is being done in AJAX, you can keep the tabs hidden and show them ($("#myTabID").show())as the lightweight, AJAX function discovers available content.

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

Sidebar

Related Questions

I have a slideshow built in flash that I want to mimic in jQuery.
I'm trying to have the built in jQuery widgets apply to dynamic content, for
I'm using jQuery UI, and have built a toolbar (a div element), with button
Good afternoon people's I have built a jquery plugin that I use on my
I have an application that uses jQuery tabs to display different dynamic content for
I have a kind of tab solution built in jquery. When a user clicks
I have a jquery slider that I have built, basically just three pannels that
I have a menu built with jquery from apycom.com that I am trying to
I have a form built with jquery. I just want to have an empty
I have built a simple menu in jQuery http://vanquish.websitewelcome.com/~toberua/ Here is a sample of

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.