The Movie Database Support

When I make a discover request with javascript and use JSON.parse, how do I access the data of the other results? Like the 2nd, 3rd, 4th,... etc result? Also, how do I use the sort by parameter?

3 replies (on page 1 of 1)

Jump to last post

Like the 2nd, 3rd, 4th,... etc result?

Do you mean the items in returned in the results of a list? If so, the results field is just an array so if you loop through it, you can get the results. If you mean pages, just add page=X to each request and you'll get each subsequent page.

There's an example iterating through the array of results here. Just make sure to change the api key on line 11.

Cheers.

That link takes me to a page with the text "Jquery Test [new line] Results" with no other text

Hi Brent,

Make a copy of the source, change line 11 with your API key and then run it. You won't be able to run the file as is, it's just a demo.

Can't find a movie or TV show? Login to create it.

Global

s focus the search bar
p open profile menu
esc close an open window
? open keyboard shortcut window

On media pages

b go back (or to parent when applicable)
e go to edit page

On TV season pages

(right arrow) go to next season
(left arrow) go to previous season

On TV episode pages

(right arrow) go to next episode
(left arrow) go to previous episode

On all image pages

a open add image window

On all edit pages

t open translation selector
ctrl+ s submit form

On discussion pages

n create new discussion
w toggle watching status
p toggle public/private
c toggle close/open
a open activity
r reply to discussion
l go to last reply
ctrl+ enter submit your message
(right arrow) next page
(left arrow) previous page

Settings

Want to rate or add this item to a list?

Login