-
Notifications
You must be signed in to change notification settings - Fork 96
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
blogPosts JSON file not found #5
Comments
Just cloned this repo and tried. None of the examples in the chapter 3 folder work. DEBUG: ------------------------------- ember-1.0.0.js:394
DEBUG: Ember.VERSION : 1.0.0 ember-1.0.0.js:394
DEBUG: Handlebars.VERSION : 1.0.0 ember-1.0.0.js:394
DEBUG: jQuery.VERSION : 1.10.2 ember-1.0.0.js:394
DEBUG: ------------------------------- ember-1.0.0.js:394
event.returnValue is deprecated. Please use the standard event.preventDefault() instead. jquery-1.10.2.min.js:5
OPTIONS file://localhost/blogPosts jquery-1.10.2.min.js:6
DEPRECATION: Action handlers contained in an `events` object are deprecated in favor of putting them in an `actions` object (error on <Ember.Route:ember279>)
at Object.triggerEvent (file://localhost/Users/macbookpro/Sites/Ember.js-in-Action-Source/chapter3/blog/js/scripts/ember-1.0.0.js:30519:13)
at trigger (file://localhost/Users/macbookpro/Sites/Ember.js-in-Action-Source/chapter3/blog/js/scripts/ember-1.0.0.js:29641:16)
at handleError (file://localhost/Users/macbookpro/Sites/Ember.js-in-Action-Source/chapter3/blog/js/scripts/ember-1.0.0.js:29903:9)
at invokeCallback (file://localhost/Users/macbookpro/Sites/Ember.js-in-Action-Source/chapter3/blog/js/scripts/ember-1.0.0.js:8055:19)
at null.<anonymous> (file://localhost/Users/macbookpro/Sites/Ember.js-in-Action-Source/chapter3/blog/js/scripts/ember-1.0.0.js:8109:11)
at EventTarget.trigger (file://localhost/Users/macbookpro/Sites/Ember.js-in-Action-Source/chapter3/blog/js/scripts/ember-1.0.0.js:7878:22)
at file://localhost/Users/macbookpro/Sites/Ember.js-in-Action-Source/chapter3/blog/js/scripts/ember-1.0.0.js:8180:17
at Object.DeferredActionQueues.flush (file://localhost/Users/macbookpro/Sites/Ember.js-in-Action-Source/chapter3/blog/js/scripts/ember-1.0.0.js:5459:24)
at Object.Backburner.end (file://localhost/Users/macbookpro/Sites/Ember.js-in-Action-Source/chapter3/blog/js/scripts/ember-1.0.0.js:5545:27) ember-1.0.0.js:394
Error while loading route:
Object {readyState: 4, getResponseHeader: function, getAllResponseHeaders: function, setRequestHeader: function, overrideMimeType: function…}
ember-1.0.0.js:394
Uncaught #<Object> ember-1.0.0.js:30566 It looks like it's looking for |
Are you hosting the application so that it is accessible via http://localhost:8080/index.html? Ember Data is expecting to find you blogPost file directly under the "/" in your web application. |
I guess that makes sense, but the code in chapters 1 and 2 can be run off of the I just set up a server using Sinatra, and though it can find the Worth noting that those are the same errors I get when using the |
I agree with @thenickcox. The book doesn't mention that this example has to be run with a webserver. (I assumed that |
I'm not sure why, but it looks like jQuery is trying to look for the blogPosts JSON, and it's not finding it. I've mirrored my app structure to yours, but something's amiss. Here's a screenshot of my Chrome inspector.
You can check out my repo here. What am I doing wrong?
The text was updated successfully, but these errors were encountered: