Check iframe source loaded with correct status code

I am trying to enable a Google Calendar iframe using a generic link that works for everyone with a google account on our domain.

 <div class="embed-responsive embed-responsive-16by9">
     <iframe class="embed-responsive-item" src="https://calendar.google.com/calendar/b/1/embed?src=..."></iframe>
 </div>

      

If the user is logged into one of the Google accounts on this domain calendar, is displayed correctly. Otherwise the iframe is empty (status code 302). In this case, I need to display some placeholders and a message to notify the user.

Access to uploaded Javascript content is blocked by a policy of the same origin.

How to check if iframe content is loaded? Thank you in advance.

+3


source to share





All Articles