简体   繁体   English

Rails 3.2,javascript执行两次

[英]Rails 3.2, javascript executing twice

I have a brand new rails app that has the following code: 我有一个全新的rails应用程序,它具有以下代码:

application.js 的application.js

//= require jquery
//= require jquery_ujs
//= require_tree .

thing.js (lives in same path as application.js) thing.js (与application.js位于同一路径)

alert("This is running");

index.html 的index.html

<%= javascript_include_tag "application" %>

When I navigate to the page, I see the alert twice. 当我导航到页面时,我会看到警报两次。 Anyone know why? 谁知道为什么? I have no pre-compiled assets. 我没有预先编译的资产。

应用程序布局已经包含application.js文件,所以这是因为application.js被包含两次。

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM