Suporte do The Movie Database

Hello guys.

As the title says, I'm getting an error using the API with IE9 and AngularJS; getting an 'Access is denied'-error. This is my error message in the console:

[object Error]{description: "Access is denied", message: "Access is denied", name: "Error", number: -2147024891}

Any solutions or work-around I can do?

Thanks in regards.

7 respostas (na página 1 de 1)

Jump to last post

Hi aventic,

We might need more info as I have never heard from anyone else about this error. So it's only IE9, other browsers are fine? Are you using JSONP?

Can you post a snippet of code showing the error? I am fairly positive the "Access is denied" is not our error (ie. not an API error), it sounds like this is something Angular is kicking back.

Here's a short snippet, as to where I'm getting the error from.

$http.get('https://api.themoviedb.org/3/search/tv' + api_key + '&query=' + serieName);

Yes it's only IE9 (I dont know about IE8 and below tho) other browsers are fine. It might be Angular causing this error, but I'm curious as to why, and if others have seen same error?

Here is a stackoverflow issue about it, but not really a solution I can use in this case: http://stackoverflow.com/questions/26304245/ie9-ie8-with-amgularjs-cors-returns-access-is-denied-asp-net-webapi

I believe switching to use JSONP will fix this, won't it?

Then I might be unaware on how to make the switch. :)

$http.jsonp('https://api.themoviedb.org/3/search/tv' + api_key + '&query=' + serieName);

Is throwing another error with 'semicolon was expected'

Then I might be unaware on how to make the switch. :)

No worries, you just need to add a callback param. Usually libraries have an option to specify this, if Angular doesn't, try adding one like this:

$http.jsonp('https://api.themoviedb.org/3/search/tv' + api_key + '&query=' + serieName + '&callback=test');

Cheers.

Aha this works very well, thanks!

This really helped me.

Found some documentation on Angulars jsonp: https://docs.angularjs.org/api/ng/service/$http#jsonp

This is what I'm using in my code now:

$http.jsonp('https://api.themoviedb.org/3/search/tv' + api_key + '&query=' + serieName + '&callback=JSON_CALLBACK');

No problem, glad I could help :D

Não consegue encontrar um certo filme ou série? Inicie sessão e adicione-o.

Geral

s focus the search bar
p abrir menu do perfil
esc close an open window
? open keyboard shortcut window

Em páginas de Média

b go back (or to parent when applicable)
e ir para a página de edição

Em páginas de temporadas de séries

(seta para a direita) ir para a próxima temporada
(seta para a esquerda) ir para a temporada anterior

Em Páginas de Episódios de Séries

(seta para a direita) ir para o próximo episódio
(seta para a esquerda) ir para o episódio anterior

Em Todas as Páginas de Imagens

a abrir janela para adicionar imagem

Em Todas as Páginas de Edição

t open translation selector
ctrl+ s submit form

Em Páginas de Discussão

n criar uma nova discussão
w toggle watching status
p toggle public/private
c toggle close/open
a abrir actividade
r reply to discussion
l ir para a última resposta
ctrl+ enter submit your message
(seta para a direita) página seguinte
(seta para a esquerda) página anterior

Definições

Deseja classificar ou adicionar este item a uma lista?

Iniciar Sessão

Ainda não é um membro?

Crie uma Conta e Adere a Comunidade