Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Uncaught Error: no such method 'show' for tooltip widget instance

I am using ajax to submit a form for my registration, but am having an issue trying to setup tooltips to display error messages for errors that come back from the controller.

JavaScript:

$(document).on('ajax:success', '.user_modal_form', function(e, data, status, xhr) {   var context;   context = $(this);   if (data.success) {     $('button', context).hide();     $('.spinner', context).show();     location.reload();   } else {     if (data.errors != null) {       $.each(data.errors, function(key, error) {         var field;         field = $("#athlete_" + key);         field.attr('data-original-title', "" + key + " " + error).tooltip({           trigger: 'manual'         }).tooltip("show");       });     }   } }); 

Error Message: Uncaught Error: no such method 'show' for tooltip widget instance

like image 339
dennismonsewicz Avatar asked Jul 03 '13 21:07

dennismonsewicz


Video Answer


1 Answers

I had the same error, which was a conflict with jQuery UI.

If you use jQuery UI then you need to reorder your script load order.

My working load order:

  • jQuery
  • jQuery UI
  • Bootstrap
like image 109
Bogdan Le Avatar answered Sep 19 '22 09:09

Bogdan Le