浏览器控制台中的错误TypeError:$(...)。aaDropdownMenu不是函数

时间:2018-09-20 07:29:59

标签: javascript ruby-on-rails ruby-on-rails-5

我需要在浏览器控制台中犯一个错误,它不会对网站造成干扰,但实际上应该不是,请帮助我删除它。

我在浏览器控制台中遇到此错误。

Uncaught TypeError: $(...).aaDropdownMenu is not a function
    at HTMLDocument.onDOMReady (dropdown-menu.self-5794b6ca26364ce522cb47a8ef050870fda0b886cfeef69ec27ef116900f1984.js?body=1:121)
    at HTMLDocument.dispatch (jquery3.self-5af507e253c37e9c9dcf65064fc3f93795e6e28012780579975a4d709f4074ad.js?body=1:5184)
    at HTMLDocument.elemData.handle (jquery3.self-5af507e253c37e9c9dcf65064fc3f93795e6e28012780579975a4d709f4074ad.js?body=1:4992)
    at Object.e.dispatch (turbolinks.self-569ee74eaa15c1e2019317ff770b8769b1ec033a0f572a485f64c82ddc8f989e.js?body=1:6)
    at r.notifyApplicationAfterPageLoad (turbolinks.self-569ee74eaa15c1e2019317ff770b8769b1ec033a0f572a485f64c82ddc8f989e.js?body=1:7)
    at r.pageLoaded (turbolinks.self-569ee74eaa15c1e2019317ff770b8769b1ec033a0f572a485f64c82ddc8f989e.js?body=1:7)
    at turbolinks.self-569ee74eaa15c1e2019317ff770b8769b1ec033a0f572a485f64c82ddc8f989e.js?body=1:6

我的宝石文件

gem 'rails', '~> 5.2.1'
gem 'activeadmin'
gem 'devise'
gem 'pg', '>= 0.18', '< 2.0'
gem 'puma', '~> 3.11'
gem 'sass-rails', '~> 5.0.7'
gem 'uglifier', '>= 1.3.0'
gem 'dotenv-rails'

gem 'coffee-rails', '~> 4.2', '>= 4.2.2'
gem 'turbolinks', '~> 5.2'
gem 'jbuilder', '~> 2.5'
gem 'bootstrap', '~> 4.1.3'
gem 'jquery-rails', '~> 4.3', '>= 4.3.3'

gem 'bootsnap', '~> 1.3', '>= 1.3.1'
gem 'font-awesome-rails', '~> 4.7', '>= 4.7.0.2'
gem "jquery-slick-rails"

gem 'paperclip', '~> 5.0'

group :development, :test do
  gem 'letter_opener'
  gem 'rspec-rails'
  gem 'byebug', platforms: [:mri, :mingw, :x64_mingw]
end

group :development do
  gem 'pry-rails'
  gem 'web-console', '>= 3.3.0'
  gem 'listen', '>= 3.0.5', '< 3.2'
  gem 'spring'
  gem 'spring-watcher-listen', '~> 2.0.0'
  gem 'capistrano', '~> 3.10', require: false
  gem 'capistrano-rails', '~> 1.4', require: false
  gem 'capistrano-bundler', '~> 1.3'
  gem 'capistrano-passenger', '>= 0.1.1'
  gem 'capistrano3-puma'
  gem 'capistrano-rvm'
end

group :test do
  gem 'capybara', '>= 2.15'
  gem 'selenium-webdriver'
  gem 'chromedriver-helper'
end

gem 'tzinfo-data', platforms: [:mingw, :mswin, :x64_mingw, :jruby]

在控制台中诅咒的一段代码

$.widget.bridge('aaDropdownMenu', ActiveAdmin.DropdownMenu);

onDOMReady = function() {
  return $('.dropdown_menu').aaDropdownMenu();    <<<<errors
};

0 个答案:

没有答案