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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 17, 20262026-06-17T09:17:38+00:00 2026-06-17T09:17:38+00:00

So my script looks like this function() { $( #tabs ).tabs(); }); function Wczytaj(link,

  • 0

So my script looks like this

function() {
    $( "#tabs" ).tabs();
});

function Wczytaj(link, div_id, parametr1, parametr2, parametr3)
{
   $.ajax(link, { data: { par1: parametr1, par2: parametr2, par3: parametr3 },
   type: "post",
     success: function(data) {
       $('#'+div_id).fadeOut("medium", function(){
       $(this).append(data);
      $('#'+div_id).fadeIn("medium");
     });
  }
 });
}
<div id="tabs">
    <ul>
        <li><a href="#id1" onClick="Wczytaj('trouble2.php','id1','null','null','null');">My id 1</a></li>
        <li><a href="#id2" onClick="Wczytaj('trouble2.php?action=lista','id2','null','null','null');">My id 2</a></li>
        <li><a href="#id3" onClick="Wczytaj('troubl2.php?action=old','id3','null','null','null');">My id3</a></li>
    </ul>

    <div id="id1"></div>
    <div id="id2"></div>
    <div id="id3"></div>
</div>

And it works without a problem, BUT I want to use also an URL address to load div content
for example, http://myurl.com/page.php#id2 should load page with selected tabs with id2 – it works, but div is empty because of onClick attribute. How to fix it?

I apologize for my english

  • 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-17T09:17:38+00:00Added an answer on June 17, 2026 at 9:17 am

    You don’t need to use your own function to AJAX load into tabs, jQuery can do this for you. Just set the href to the URL, and don’t add the <div>s.

    <div id="tabs">
        <ul>
            <li><a href="trouble2.php">My id 1</a></li>
            <li><a href="trouble2.php?action=lista">My id 2</a></li>
            <li><a href="trouble2.php?action=old">My id3</a></li>
        </ul>
    </div>
    

    jQuery will make the tabs, and automatically load the page via AJAX. See the docs here: http://jqueryui.com/tabs/#ajax

    It will also make the <div> for you. In the example, they are named ui-tabs-X, where X is the tab index. So, http://myurl.com/page.php#ui-tabs-2 should load the page with your 2nd tab open.

    Check out jQuery’s demo here: http://jqueryui.com/resources/demos/tabs/ajax.html#ui-tabs-2

    EDIT: If you want to run a function before or after the remote tabs are loaded, jQuery UI provides the tabsbeforeload and tabsload events.

    They can be bound when creating the tabs:

    $('#tabs').tabs({
        beforeLoad: function(event, ui){
            alert('loading');
        },
        load: function(event, ui){
            alert('loaded');
        }
    });
    

    Or they can be bound afterwards:

    $('#tabs').on('tabsbeforeload', function(event, ui){
        alert('loading');
    });
    
    $('#tabs').on('tabsload', function(event, ui){
        alert('loaded');
    });
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I have a script that looks like this #!/bin/bash function something() { echo hello
I'm using http://jqueryfordesigners.com/jquery-tabs/ for a project, the tabbing javascript code looks like this: <script
I'm using http://jqueryfordesigners.com/jquery-tabs/ for a project, the tabbing code looks like this:- <script type=text/javascript
My script currently looks like this: <script type=text/javascript> function updateMe(){ var x = 0;
I have a test powershell V2 script that looks like this: function test_args() {
I have a batch script that looks like this: Test.bat @echo off :: Starts
I have a bash script that looks like this: #!/bin/sh previousRelease=`git describe --tags --match
If I have a simple web page and script that looks like this: <body>
I have a script that starts Tomcat and it looks like this: rem set
I have a line of php code that looks like this: echo <script>$('#edit_errors').html('<h3><em>Please Correct

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.