documentcloud / document-viewer

The NYTimes Document Viewer
http://open.blogs.nytimes.com/2010/03/27/a-new-view-introducing-doc-viewer-2-0/
Apache License 2.0
691 stars 120 forks source link

Trying to set local json #38

Closed navneetccna closed 10 years ago

navneetccna commented 10 years ago

i created a local json and paste json from http://documents.nytimes.com/goldman-sachs-internal-emails.json in it. getting following exception

Uncaught TypeError: Cannot read property 'schema' of undefined viewer.js:685 DV.loadJSON viewer.js:685 deferred.resolveWith viewer.js:51 done viewer.js:452 callback

knowtheory commented 10 years ago

Hey @navneetccna, we don't actually have enough information to know why you're getting an error there.

In most cases it's difficult to mix content loaded from file:// urls and http:// urls. As a more general work around, the viewer allows you to read a JSON object loaded on page directly.

If you flip open the source and search for DV.load on any of our document pages you can see that we're just injecting a literal JSON object into the page (for example https://www.documentcloud.org/documents/1004523-christie-document-exhibit-b.html ).

That should get you where you need to go.