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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 27, 20262026-05-27T03:08:45+00:00 2026-05-27T03:08:45+00:00

From jQuery UI tabs : <script> $(function() { $( #tabs ).tabs({ ajaxOptions: { error:

  • 0

From jQuery UI tabs:

<script>
$(function() {
    $( "#tabs" ).tabs({
        ajaxOptions: {
            error: function( xhr, status, index, anchor ) {
                $( anchor.hash ).html("Couldn't load this tab.");
            }
        }
    });
});
</script>


<div class="demo">

<div id="tabs">
    <ul>
        <li><a href="#tabs-1">Preloaded</a></li>
        <li><a href="ajax/content1.html">Tab 1</a></li>
        <li><a href="ajax/content2.html">Tab 2</a></li>
    </ul>
    <div id="tabs-1">
        <p>Proin elit arcu, rutrum commodo.</p>
</div>

How to send ajax request with post data in this case (maybe through ajaxOptions).

I do not know how to modify tabs urls to send post data, for example:

<li><a href="ajax/content1.html(country:1,city:35)">Tab 1</a></li>
<li><a href="ajax/content2.html(code:'aa')">Tab 1</a></li>

Thanks!

EDITED:

In jQuery it’s:

$.load("some_url",{country: countryValue});

So I have post header (country) and post value (countryValue).
How to do the same with each 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. Editorial Team
    Editorial Team
    2026-05-27T03:08:46+00:00Added an answer on May 27, 2026 at 3:08 am

    To make the AJAX method POST, you can add a type to the ajaxOptions object. To collect data for the post, you could take advantage of jQuery.data() and then hide the POST parameters in the anchor.

    <div id="tabs">
        <ul>
            <li><a href="#tabs-1">Preloaded</a></li>
            <li><a href="ajax/content1.html">Tab 1</a></li>
            <li><a href="ajax/content2.html" data-country="1" data-city="35">Tab 2</a></li>
            <li><a href="ajax/content3-slow.php">Tab 3 (slow)</a></li>
            <li><a href="ajax/content4-broken.php">Tab 4 (broken)</a></li>
        </ul>
        <div id="tabs-1">
            <p>Proin elit arcu, rutrum commodo.</p>
    </div>
    

    And the JavaScript:

    var postData = {};
    
    $("#tabs").tabs({
        select: function(event, ui) {
            postData = {
                country: parseInt($(ui.tab).data('country')),
                city: parseInt($(ui.tab).data('city'));
            };
        },
        ajaxOptions: {
            type: 'POST',
            data: postData,
            error: function(xhr, status, index, anchor) {
                $(anchor.hash).html("Couldn't load this tab. We'll try to fix this as soon as possible. " + "If this wouldn't be a demo.");
            }
        }
    });
    

    Try it: JSFiddle

    If your parameters change for each link, you’ll have to come up with a way to know which parameters you’re looking for. You could get the index of the tab in the select() event using ui.index and use a switch to get different parameters for each case. Admittedly this solution isn’t very pretty, but it could work.

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

Sidebar

Related Questions

I am using Jquery UI Tabs for my website. <script type='text/javascript'> //<![CDATA[ jQuery(window).load(function(){ jQuery('#myTabs').tabs({
i have some simple jquery tabs: <script> $(function() { $( #tabs ).tabs(); }); </script>
I am using jquery tabs to load content from a remote file. I have
I have different php output in jQuery-based tabs. This output is formed from database
I have a page that uses jQuery tabs to tabify a set of HTML
I have a jQuery tab script that gets content from a PHP file defined
I have a jQuery tabbed search script that gets content from a PHP file
I have a jQuery search script that uses tabs for the user to define
I have a jQuery search script that uses tabs for the user to define
I'm using jQuery to create a load of tabs for a web application. I've

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.