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
javascript html cross-domain iframe


source to share


No one has answered this question yet

Check out similar questions:

749
"Cross origin requests are only supported for HTTP." error loading local file
746
What's the correct way to check for string equality in JavaScript?
591
Calling JavaScript code in an iframe from the parent page
516
How to determine if a webpage is loading inside an iframe or directly in the browser window?
462
SecurityError: Blocked source frame from accessing cross origin frame
46
Unable to display HTML string
29
Detect when iframe starts loading new url
1
"Rules" to keep in mind when working with cross-domain iframe content
1
Load another domain site in an iframe
0
How to display web url in iframe tag without hijacking?



All Articles
Loading...
X
Show
Funny
Dev
Pics