Empresas
Empregos
  • Sobre nós
  • Soluções
    • Publicação de vagas
      Publique sua vaga e receba candidatos qualificados em 48h.
    • Avaliações de candidatos
      Mais de 500 testes técnicos e psicológicos, mais anti-fraude.
    • Headhunting
      Busca executiva personalizada do início ao fim.
    • Folha de Pagamento + EOR
      Dispersão de folha e EOR em mais de 15 países da LATAM.
  • Preços
  • Empregos

0

335
Visualizações
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 à pergunta
Encontrar trabalhos remotos

Descubra a nova forma de encontrar um emprego!

melhores empregos
Principais categorias de trabalho
Empresas
Postar vaga Preços Comercial
Jurídico
Termos e Condições Política de privacidade
© 2026 PeakU Inc. All Rights Reserved.
Andres GPT
Recomende algumas ofertas para mim
Preciso de ajuda