ruby - Javascript file not executing in Sinatra application -


app.rb

require 'sinatra'  '/'     haml :home end 

home.haml

!!! %html %head   %title app %body   .wrapper %script(src="js/app.js") 

folder structure:

/myapp/app.rb /myapp/views/home.haml /myapp/public/js/myapp.js 

the template seems load javascript file:

firebug

however not execute. javascript draws html5 canvas , appends wrapper div. if type in url "localhost:4567/js/myapp.js" script shown, i'm assuming sinatra correctly serving up, it's not executing.

fixed, forgot add jquery script, script wasn't loading because using $(document).ready functionality.


Comments

Popular posts from this blog

java - How to specify maven bin in eclipse maven plugin? -

single sign on - Logging into Plone site with credentials passed through HTTP -

php - Why does AJAX not process login form? -