在我的rails想设置jQuery和jQuery UI的3.1.1应用为什么我的JS jQuery不工作?
在我看来,我有
<a href="#" id="test_link1">Test</a>
<div id="dialog-modal" title="Basic modal dialog" style="display:none;">
<p>Adding the modal overlay screen makes the dialog look more prominent because it dims out the page content.</p>
</div>
<script type="text/javascript">
$("#test_link1").click(function() {
('#dialog-modal').dialog();
});
它不工作。当我检查我得到
storages:105TypeError: 'undefined' is not a function (evaluating '('#dialog-modal').show()')
});
在application.js中。文件被加载
//= require jquery
//= require jquery_ujs
//= require jquery-ui.min
我傻,但错误依然存在。这是什么意思? – Gaelle
应该是一个不同的错误,但你可以尝试将它包装在文档就绪函数'$(function(){// put code here});' – swatkins
包装但是当我点击链接时出现同样的错误 – Gaelle