1

I am trying to click a sidebar Menu (div #cssmenu) element and if so it loads content into a div (#tabs). The problem is that the content has a load in it's structure (so it does a load of load) and i think it is the reason i get this warning and error :

Synchronous XMLHttpRequest on the main thread is deprecated because of its detrimental effects to the end user's experience.

Undefined is not a function on line pane.tab('show');

This just disable all my dropdown menus in #cssmenu. Thank any help !

$( document ).ready(function() {
$('#tab_quick').load($('#tabs .active a').attr("data-url"),function(result){
  $('.active a').tab('show');
});

$('#tabs a').click(function (e) {
    e.preventDefault();

    var url = $(this).attr("data-url");
    var href = this.hash; 
    var pane = $(this);

    // ajax load from data-url
    $(href).load(url,function(result){      
        pane.tab('show');
    });

  });
});



$( document ).ready(function() {    
    $('#cssmenu a').click(function (e) {
        e.preventDefault();

        var url = $(this).data('url'); 
        var pane = $(this);

        // ajax load from data-url
        $('#tabs').load(url, function(result){ // load the content directly to #tabs     
            pane.tab('show'); // display the tab
        });   
    });
});
João Pedro
  • 546
  • 1
  • 5
  • 19
  • That message is just a warning, it doesn't change the behavior. – Barmar Mar 01 '15 at 21:17
  • Are you loading elements that should have dropdown menus dynamically? If so, see http://stackoverflow.com/questions/203198/event-binding-on-dynamically-created-elements – Barmar Mar 01 '15 at 21:19
  • I forgot , i get an error: Undefined is not a function on line pane.tab('show'); – João Pedro Mar 01 '15 at 21:19
  • Sounds like you forgot to load a plugin file although most tab plgins usually use `tabs()` not `tab()` – charlietfl Mar 01 '15 at 22:22

0 Answers0