Empresas
Empleos
  • Sobre nosotros
  • Soluciones
    • Publicación de vacantes
      Publica tu vacante y recibe candidatos calificados en 48h.
    • Evaluación de candidatos
      500+ pruebas técnicas y psicológicas, más anti-fraude.
    • Headhunting
      Búsqueda ejecutiva a la medida de principio a fin.
    • Nómina + EOR
      Dispersión de nómina y EOR en más de 15 países de LATAM.
  • Precios
  • Empleos

0

248
Vistas
Why is my JavaScript code receiving a "No 'Access-Control-Allow-Origin' header is present on the requested resource" error?

I am trying to create an app that would get the live comments from one of my live videos on my FB page and would play a notification sound whenever someone comments. I'm quite new to APIs and I tried reading the Graph API documentation for live comments here: https://developers.facebook.com/docs/graph-api/server-sent-events/endpoints/live-comments

Here is a sample that was given to subscribe to the endpoint and get the live comments:

var source = new EventSource("https://streaming-graph.facebook.com/{live-video-id}/live_comments?access_token={access-token}&comment_rate=one_per_two_seconds&fields=from{name,id},message");
source.onmessage = function(event) {
  // Do something with event.message for example
};

My access token works fine. Checked it on the Access Token Debugger. The access token has the proper permissions based on the documentation on the live-comments endpoint link above.

I tried the code out and it seems like the API call is successful because it's returning a status code of 200, but I'm getting this particular error message enter image description here

I tried searching for what to do and I can't find anything that can help me on fixing this. I am completely lost. I hope someone can help me fix this or even just point me to the right direction.

about 4 years ago · Juan Pablo Isaza
Responde la pregunta
Encuentra empleos remotos

¡Descubre la nueva forma de encontrar empleo!

Top de empleos
Top categorías de empleo
Empresas
Publicar vacante Precios Comercial
Legal
Términos y condiciones Política de privacidad
© 2026 PeakU Inc. All Rights Reserved.
Andres GPT
Recomiéndame algunas ofertas
Necesito ayuda