<% else %>
<% end %>
×
<%= msg %>
<% end %>
In my assets/javascripts/application.js I have:
$(".alert-message").alert()
$(".alert-message").alert('close')
Not sure I need both? tried with .alert / .alert-error as well.
Nothing happens when I click the close symbol, I'm sure I'm missing something very obvious, but I'm new to using JS /w Rails, can't figure this out.
In the Chrome JS console I see this error message, which seems to be about bootstrap-alert.js data-api:
`Uncaught TypeError: Object [object Object] has no method 'on'`
Many thanks for any tips!
Seconds after clicking 'submit' on this question you realise the problem... The problem was caused by having 'jquery.js' and 'jquiery-ui.js' also in the javascripts folder, must be having clashing names/classes. After removing the jquiery files the js error disappeared on loading the page and the alert-dismissal works now... d'oh
Seconds after clicking 'submit' on this question you realise the problem... The problem was caused by having 'jquery.js' and 'jquiery-ui.js' also in the javascripts folder, must be having clashing names/classes. After removing the jquiery files the js error disappeared on loading the page and the alert-dismissal works now... d'oh
以上就是Bootstrap alert dismissal not working, rails 3.2的详细内容,更多请关注web前端其它相关文章!
未经允许不得转载:web前端首页 » JavaScript 答疑
相关文章
评论 抢沙发
前端开发相关广告投放 更专业 更精准
联系我们觉得文章有用就打赏一下文章作者
支付宝扫一扫打赏

微信扫一扫打赏
