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

135
Vistas
JSON syntax error when running page in iFrame

I'm developing a website where users can book a table in a restaurant online. Everything's working fine, except one thing: When I put the reservation page in an iFrame on another domain, in a lot of browsers I get an error Unexpected token < in JSON at position 0 at JSON.parse (<anonymous>). The Network -> Response tab in DevTools tells me, that response data could not be loaded because the request has been redirected.

This is the page that works well: https://dev.table4u.de/dimostrazione

Here I put the page in an iFrame for testing: https://www.restaurant-zukunft.de/iframe-test

This error comes up in a lot of browsers except Firefox, so could this be a problem with formatting the data?

about 4 years ago · Juan Pablo Isaza
1 Respuestas
Responde la pregunta

0

No, this is not a problem related to data. It's a problem with Chrome (and other browser). It is very strict when you use iframe. When you send POST request to https://dev.table4u.de/index.php?option=com_tablebooking&task=search.getWorkingHours, you can remark that cookie is not sent.

enter image description here

It's not the same for Firefox :

enter image description here

So, you're backend part think that the current client is not trusted so it redirects the link instead of given you the JSON that you expect.

Chrome (and other browser) avoid to send cookie because domain is changed due to SameSite policy (You can check on the internet what is it exactly). It expected www.restaurant-zukunft.de but you use dev.table4u.de on POST request. You can temporarly disable this behaviour on Chrome by changing the following flag.

enter image description here

You can found it on chrome://flags/. But it's a very bad idea to do this. In your case, try to use same domain. Or avoid to use iframe if possible.

about 4 years ago · Juan Pablo Isaza Denunciar
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