我正在尝试基于#381 railscast 剧集运行一个简单的 javascript 文件。但是,当我在我的 javascript 文件中放置警报时,它不会在我加载页面时出现。我确信在查看源代码时文件本身已加载。任何想法为什么它没有加载?
应用程序.js:
// This is a manifest file that'll be compiled into application.js, which will include all the files
// listed below.
//
// Any JavaScript/Coffee file within this directory, lib/assets/javascripts, vendor/assets/javascripts,
// or vendor/assets/javascripts of plugins, if any, can be referenced here using a relative path.
//
// It's not advisable to add code directly here, but if you do, it'll appear at the bottom of the
// the compiled file.
//
// WARNING: THE FIRST BLANK LINE MARKS THE END OF WHAT'S TO BE PROCESSED, ANY BLANK LINE SHOULD
// GO AFTER THE REQUIRES BELOW.
//
//= require jquery
//= require jquery_ujs
//= require jquery-fileupload/basic
//= require jquery-fileupload/vendor/tmpl
//= require js-routes
//= require twitter/bootstrap
//= requre_self
//= require_tree .
images.js.coffee:
jQuery ->
alert("hello world")
$('#new_image').fileupload
dataType: "script"