Business
Jobs
  • About Us
  • Solutions
    • Job Postings
      Post your job and receive qualified candidates in 48h.
    • Candidate Assessments
      500+ technical and psychological tests, plus anti-fraud.
    • Headhunting
      Tailor-made executive search from start to finish.
    • Payroll + EOR
      Payroll dispersal and EOR across 15+ LATAM countries.
  • Pricing
  • Jobs

0

330
Views
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
Answer question
Find remote jobs

Discover the new way to find a job!

Top jobs
Top job categories
Business
Post vacancy Pricing Sales
Legal
Terms and conditions Privacy policy
© 2026 PeakU Inc. All Rights Reserved.
Andres GPT
Show me some job opportunities
There's an error!