marcamillion marcamillion - 1 year ago 106
Javascript Question

Uncaught TypeError is not a function on AJAX callback

In my

file, I have the following:

$(document).ready(function() {
/* Activating Best In Place */

$('.highlight_on_success').bind("ajax:success", function(){$(this).closest('').effect('highlight');});

I am using the Best In Place gem, and it gives me the above function to use in my

However, when I use it, I get this error in my JS console:

Uncaught TypeError: $(...).closest(...).effect is not a function application.self-440dd817e40548768e9.js:25

How do I fix this and get it work?

Answer Source

effect() is part of jQueryUI not jQuery core so either need to find a different editing script that doesn't have dependencies other than some css or use jQueryUI also in page to include that function.

Personally I would look for a different editor like X-ediable or other simlar plugin