You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
I need to be able to dynamically update this with new items (from the CMS), I have a file in the root called data.json, that I'm trying to load instead of using movies.js.
Inside my data.json I have...
var movies = [
{
"id": 1,
"name": "I am a title",
"rating": "★★★★",
"year": 2017
...
I've tried the following, but it doesn't seem to work. Streaming stays at 0% and no results load.
If I add the json data into the HTML like this it works, but it's still not loading the data.json as streaming is at 0%, and the page obviously takes a lifetime to load.
I know I could add this into a movies.js file but then I can't add new movies dynamically using the CMS.
<script>
var movies = [
{
"id": 1,
"name": "I am a title",
"rating": "★★★★",
"year": 2017
...
I've also tried reverting to the example pagination.js file, but the same problem occurs. Could it be something to do with loading the json from my local MAMP setup?
I've tried using an explicit URL e.g. http://example.dev/data.json?
(I deliberately tried adding an incorrect url in e.g. http://example.dev/blah.json, I get an error in the console. So it seems like it is detecting the json file.)
The text was updated successfully, but these errors were encountered:
Hi
My
movies
variable has 200 items in it.I need to be able to dynamically update this with new items (from the CMS), I have a file in the root called
data.json
, that I'm trying to load instead of usingmovies.js
.Inside my
data.json
I have...I've tried the following, but it doesn't seem to work. Streaming stays at 0% and no results load.
I've also tried just using the following. But this doesn't work either.
If I add the
json
data into the HTML like this it works, but it's still not loading thedata.json
as streaming is at 0%, and the page obviously takes a lifetime to load.I know I could add this into a
movies.js
file but then I can't add new movies dynamically using the CMS.I've also tried reverting to the example
pagination.js
file, but the same problem occurs. Could it be something to do with loading thejson
from my local MAMP setup?I've tried using an explicit URL e.g.
http://example.dev/data.json
?(I deliberately tried adding an incorrect url in e.g.
http://example.dev/blah.json
, I get an error in the console. So it seems like it is detecting thejson
file.)The text was updated successfully, but these errors were encountered: