IONIC - CHECK IF AN IFRAME HAS BEEN LOADED 100%

Asked

Viewed 110 times

0

I’m embedding an iframe with a google maps link inside my Onica application, how do I check if the frame was loaded 100%? Because, depending on the user’s internet connection, it may take a few seconds to load and during those seconds, I would like to perform an action.

  • How are you calling iframe? only in HTML?

  • Yes, Felipe....

  • <iframe src="https://www.google.com/maps/embed?pb=! 1m18! 1m12! 1m3! 1d3656.976123884744! 2d-46.65830728502199! 3d-23.56930098467905! 2m3! 1f0! 2f0! 3f0! 3m2! 1i1024! 2i768! 4f13.1! 3m3! 1m2! 1s0x94ce59c41d440a33%3A0xfde78c1318fcbc9c! 2sAlameda+Campinas%2C+977+-+Jardim+Paulista%2C+S%C3%A3o+Paulo+-+SP%2C+01404-001! 5e0!3m2! 1spt-BR! 2sbr! 4v1530191321720" width="600" height="450" frameborder="0" style="border:0" allowfullscreen></iframe>

1 answer

0

You can use the angular Event-bind: (load)="function()"

As in the example below:

<iframe name="chatFrame" src="http://..." (load)="dismissLoading()"></iframe>

The function indicated in the load will be executed at the end of the load

Browser other questions tagged

You are not signed in. Login or sign up in order to post.