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

331
Vistas
How to get iFrame content loading status code?

I am trying to access the status code of the request fired when I set the src attribute of the iFrame.

Here is my code:-

$('.player-modal-button').on('click', function (e) {

    var dataSource = $(this).data('src');

    var playerModal = $('#player-modal');
    playerModal.modal();
});

Because I am setting the src later on button click, there is another request fired to load the video.

Google Chrome Network Tab Output

Request URL: http://mywebsite.com/videos/play/4328
Request Method: GET
Status Code: 302 Found

Note:- This request is fired automatically by the browser when the iFrame src is set.

This request returns a 302 status code if the user has logged out automatically for some reason. And then login page gets loaded in the iFrame.

What I want to do is display an alert the first time it returns a 302 status code. But I do not know how to track the request in javascript.

Can someone please guide me how to get the status code from the browser?

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