我有Rails应用程序,在这里我修改了一些文件,然后运行bundle instal和asset:precompile。
之后,我在文件至极的错误没有更改。发生错误的文件部分:
<script type="text/javascript">
function openCurrentTab() {
var hash = window.location.hash || '#info'
$('a[href=' + hash + ']').tab('show')
}
$(function() {
openCurrentTab()
$('#outage-tabs > li > a').click(function(evt) {
evt.preventDefault()
$(this).tab('show')
history.pushState(null, null, this.hash)
})
})
window.onpopstate = openCurrentTab
</script>
错误(在控制台中)
application-76c7fea….js:24 Uncaught Error: Syntax error, unrecognized expression: a[href=#info]
谢谢你的帮助
似乎您的jQuery搜索有错误
$('a[href=' + hash + ']').tab('show')
使用结尾选择器和下一个语法:请勿在词条内使用#,而应使用''来设置搜索词
$("a[href$='hash-without-#-symbol']")
本文收集自互联网,转载请注明来源。
如有侵权,请联系 [email protected] 删除。
我来说两句