尝试在我的Rails应用程序上安装Jquery Match Height后,我收到以下错误。
我尝试过使用Match Height Gem,只需将整个脚本复制粘贴到我的application.js
中,并且(目前)在我的application.html.erb
上包含CDN:
<script src="https://cdnjs.cloudflare.com/ajax/libs/jquery.matchHeight/0.7.2/jquery.matchHeight.js" type="text/javascript"></script>
无论如何都会产生相同的错误。我安装了这些与jquery相关的gem:
gem 'jquery-rails'
gem 'jquery-ui-rails'
以下是我尝试使用Match Height的方法:
<script>
$(document).ready(function() {
$('.card-img-top').matchHeight();
$('.card-title').matchHeight();
$('.card-text').matchHeight();
$('.card-footer').matchHeight();
});
</script>
谁能看到我做错了什么?
如果你使用宝石jquery-matchheight-rails,不需要CDN包括
将以下内容添加到JavaScript清单文件中:(application.js)
//= require jquery.matchHeight