The iframe.onload event (on the tag) is essentially the same as iframe.contentWindow.onload (on the embedded window object). It triggers when the embedded window fully loads with all resources. …But we can’t access iframe.contentWindow.onload for an iframe from another origin, so using iframe.onload.
For More Information Please Refer:
You May Also Like to Read: