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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 13, 20262026-05-13T07:29:11+00:00 2026-05-13T07:29:11+00:00

I’m using jquery tabs ( http://docs.jquery.com/UI/API/1.7.2/Tabs ). Jquery version 1.3.2 and Jquery UI version

  • 0

I’m using jquery tabs (http://docs.jquery.com/UI/API/1.7.2/Tabs). Jquery version 1.3.2 and Jquery UI version 1.7.2 and Ive been testing in firefox 3.5.6.

When selecting a tab I just add the current date to the content area html. I also have a link with the class name “Button”. When this link is clicked I want to reload the content of the currently selected tab. But with the solution I’ve tried I can’t get it to work. I can see that the “button clicked” event is loaded but the following code isn’t reloading my data:

$(".Tabs").tabs('load', $(".Tabs").tabs('option', 'selected'));

I have also been testing with:

var selected = $(".Tabs").tabs('option', 'selected');
$(".Tabs").tabs('select', null);
$(".Tabs").tabs('select', selected);

But that doesn’t work either, my select method never gets called when pushing the button

This is my jquery code:

    $(function() {
    var $tabs = $(".Tabs").tabs({
        selected: null,
        select: function() {
            alert("this doesn't run on button click");
            //Sets Content's html to current date
            $("#Content").html(new Date);
        }
    });

    $('.Button').click(function() {
        alert("this runs on button click");
        //Here I want to reload the current selected tab
        $(".Tabs").tabs('load', $(".Tabs").tabs('option', 'selected'));
        return false;
    });
    $('.Tabs').tabs('select', 0); // Select first tab
});

This is the html:

<div class="Tabs">
    <ul>
        <li><a href="#Content">Tab1</a></li>
        <li><a href="#Content">Tab2</a></li>
    </ul>
    <div id="Content">

    </div>
</div>
<a class='Button' href='#'>Load Content Again</a>
  • 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-13T07:29:12+00:00Added an answer on May 13, 2026 at 7:29 am

    if your .Button class is inside the content that is loaded, you will need to use the live functionality of jQuery.

    $('.Button').live('click', function() {
     //Here I want to reload the current selected tab
     $tabs.tabs('load', $tabs.tabs('option', 'selected'));
     return false;
    });
    

    Also, since .Button is a link, you’ll need to add return false; inside that function.


    From looking over your code, I’m not sure why you have it set up to not load a tab until after you click on one. Also clicking on any tab will always load the same content (the url doesn’t change). And lastly, you shouldn’t need to use eval() the script (could this be the problem?).

    Besides these issues, it looks like your code should work.

    I’m also not sure how your json is formatted, so I rewrote this assuming the following json format:

    ({
     "items": [
      { "title": "example 1" },
      { "title": "example 2" },
      { "title": "example 3" },
      { "title": "example 4" },
      { "title": "example 5" },
      { "title": "example 6" },
      { "title": "example 7" },
      { "title": "example 8" },
      { "title": "example 9" },
      { "title": "example 10" }
     ]
    })
    

    Script

    $(function() {
     var $tabs = $(".Tabs").tabs({
      selected: null,
      select: function(event, ui) {
       loadTab( ui.index ); // ui.index = index of the clicked tab
      }
     });
     $('.Button').live('click', function() {
      //Here I want to reload the current selected tab
      loadTab( $(".Tabs").tabs('option', 'selected') );
      return false;
     });
     $('.Tabs').tabs('select',0);
    });
    
    function loadTab(indx){
     $.ajax({
      type: "GET",
      url: "http://domain.com/Service.svc/get",
      dataType: "json",
      success: function(data) {
       var content = "";
       $.each(data.items, function(items){
        content += "<a class='Button' href='#'>" + this.title + "</a><br>";
       });
       $("#Content").html(content + "<br />Tab Index #" + indx + " on " + (new Date()).toUTCString());
      },
      error: function(XMLHttpRequest, textStatus, errorThrown) {
       if (!$('#error').length) $("#Content").prepend('<div id="error"></div>');
       $('#error').html(textStatus + '<br /><br />');
      }
     })
    }
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I have a jquery bug and I've been looking for hours now, I can't
I am reading a book about Javascript and jQuery and using one of the
I'm making a simple page using Google Maps API 3. My first. One marker
I have a .ini file as follows: [playlist] numberofentries=2 File1=http://87.230.82.17:80 Title1=(#1 - 365/1400) Example
I'm new to using the Perl treebuilder module for HTML parsing and can't figure
That's pretty much it. I'm using Nokogiri to scrape a web page what has
link Im having trouble converting the html entites into html characters, (&# 8217;) i
I have a string like this: La Torre Eiffel paragonata all&#8217;Everest What PHP function
I'm using v2.0 of ClassTextile.php, with the following call: $testimonial_text = $textile->TextileRestricted($_POST['testimonial']); ... and
We're building an app, our first using Rails 3, and we're having to build

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.