How do I listen for jump events in an iframe page?

suppose I have a root page. The index page introduced into the root is < iframe src= "index.html" name= "index" id= "index" frameborder= "0" > < / iframe > , and the
index page can be clicked to jump to the pages such as A Magi BJ C and so on. Then how can I hear the jump in the index page in the js of the root page and stop the index jump? all I need to do is get URL

.
Feb.26,2021

you can listen that onload,iframe will trigger when there is a jump.
var iframe = document.getElementById ('index');
iframe.onload = function () {

console.log(123)

}


I encountered the same problem as you when doing third-party login. After the user enters the authorization page of the third party, the page of the third-party platform will jump to the callback address. I just need to get the parameters on the callback address. I just need to listen to the onload event of iframe and get the address. I don't know if there's a better way to get the address before onload

.
Menu