Rectangle 27 0

select:function(event, ui) {
    $("#tabs").tabs("option", "ajaxOptions",{
        type: 'POST',
        data: {userId:$('userid')},
        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.");

When you define ajaxOptions initially it uses this value for any subsequent request. But for some reason its not getting the current value. I even tried changing just the userId on select and it failed to modify it. They may be cloning the value, im not sure. Anyway if you set ajaxOptions before the request, it will send what you want.

Sorry for the half baked answer, but I couldn't let it go. +1 on the question. I had to do a little research to figure out why it wasn't working.

Note: You probably already know this, but you must be running on a server to POST. POST to the local file system will generate an error.

One more thing. Is your server setup to process the .html extension? I pointed the url in the second tab to a php file with the following content <?php echo "<p>HELLO WORLD {$_REQUEST['userId']}</p>"; It printed 'HELLO WORLD 1234'

Passing variable via ajax with Jquery Tabs - Stack Overflow

jquery jquery-ui jquery-tabs
Rectangle 27 0

DEMO - Appending the anchor HTML value

I'm not sure why you can't get the anchor value out. You are already in the anchor.

You are binding the click event to the anchor. It only adds to the confusion that you name the local variable referencing the current anchor button.


You can do the following if you want to append the anchor HTML instead:


In case the link to the DEMO goes stale, here is the new code:

$('.ordered-list li a').on("click", function() {
    var button = $(this); // not a button! "this" is referencing the clicked anchor.
    $('.overlay').fadeIn('slow', function() {
$('.icon-remove').click(function() {
    $('.overlay-content-inner, .overlay-title-content').empty();

javascript - How do I clone and append anchor html value of javascript html5 jquery-ui jquery