I'm very new to APIs and jQuery in general and am trying to work out how to simply retrieve a movie poster.
$.getJSON("https://api.themoviedb.org/3/search/movie?api_key=XXXX&query=interstellar", function (response) {
$("#poster").html("<img src=" + response.results[0].poster_path + "/>");
});
I've also got a working jsFiddle here (link removed), but it's trying to retrieve this image from the jsFiddle website rather than tmdb. I realise I have to add something to start of that img src
but have tried various combinations of (https://api.themoviedb.org/3/movie/157336/images + response.results[0].poster_path + ?api_key=XXXX)
to no avail.
Could anyone point me in the right direction?
Any help is appreciated. Thanks!
P.S. While I may not have a working bit of code, this whole API thing is new to me and it's blowing my f****** mind!!! Oh, the possibilities...
찾으시는 영화나 TV 프로그램이 없나요? 로그인 하셔서 직접 만들어주세요.
이 항목을 평가하거나 목록에 추가할까요?
회원이 아닌가요?
realph님의 댓글
8월 1, 2014 at 2:14 오후
Sorry to sound silly. But where do I get the
base_url
andposter_size
from?