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

  • SEARCH
  • Home
  • 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 6071593
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 23, 20262026-05-23T10:03:54+00:00 2026-05-23T10:03:54+00:00

Ok, so basically I’m using ui.tabs and I want to have a link in

  • 0

Ok, so basically I’m using ui.tabs and I want to have a link in the first tab trigger the adding of 2 new tabs, both of which will be populated by an ajax call which is dependent on the value of the link clicked. I have the following HTML:

<div id="a">
    <div class="wrapper">
        <input class="imageID" type="hidden" value="11">
        <a href="#addTab" class="tabButton">asdfasdfasdfasfasf</a>
    </div>
    <div class="wrapper">
        <input class="imageID" type="hidden" value="1">
        <a href="#addTab" class="tabButton">asdfasdfasdfasfasf</a>
    </div>
</div>

And then the jQuery so far looks like this:

$(function(){
    var tabs = $("#tabs").tabs();
    $('.tabButton').click(function(){
        tabs.tabs('add','test.htm','Summary');
        tabs.tabs('add','test.htm','Read Topic');
    });

    $(".tabButton").live("click", function(){
        var getImageID = $(this).parent();
        $.get("ajax.php?c=" + $(".imageID",getImageID).val(), function() {

        });
    });
});

Now the jQuery works so far, it’s picking up the value of the hidden input field properly and returning the correct response from ajax.php (visible in Firebug’s console), but what I have no idea how to achieve is how to have the tabs added with the correct information. Basically, ajax.php queries a database and pulls out the content of 2 fields (obviously the record varies depending on the value sent). The content of the first field would then be displayed in the new ‘Summary’ tab, and the content of the second field would be placed in the second new tab, ‘Read Topic’. However, I have no idea how to structure the jQuery to achieve this (I’m fairly new to the subject).

(Obviously I’m aware that lines 3-6 of the jQuery won’t be needed once this is coded correctly).

  • 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-05-23T10:03:55+00:00Added an answer on May 23, 2026 at 10:03 am

    Ok, so I’ve used elements of the other answers, and ended up with this working code:

    $(function(){   
        var tabs = $("#tabs").tabs();
        $(".tabButton").live("click", function(){
            var getImageID = $('.imageID',$(this).parent()).val();
                tabs.tabs('add', 'ajax.php?content=summary&id=' + getImageID, 'Summary');
                tabs.tabs('add', 'ajax.php?content=read&id=' + getImageID, 'Read Topic');
        });
    });
    

    with the link that causes it to fire being the same as in my original question. I think the reason I’ve done it differently is because I’ve fired it off a button click. Does this seem a correct and reasonable use of jquery?

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

Sidebar

Related Questions

Basically I have an entity (called Session) which will provide many different Services. Each
Basically for a Facebook tab I have a PHP app and want Heroku to
Basically I want to know how to set center alignment for a cell using
Basically, I have a JTextPane to hold some text which I wish to style.
Basically I have converted a tab delimited txt file into a list containing a
Basically, I have a main page (parent page) with a link that opens up
Basically I have an IFRAME that contains a given page - I want to
Basically I have a loop incrementing i, and I want to do this: var
Basically in my in my aspx page I have a gridview which displays the
Basically I have some sort of third party software running on Windows 7 which

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.