This article describes the method of JS to implement iframe to get the parent window URL address. Share it for your reference. The specific implementation method is as follows:
var url='';try { url = window.top.document.referrer ; } catch(M) { if (window.parent) { try { url = window.parent.document.referrer; } catch(L) { url = ""; } } } } if (url === "") { url = document.referrer;}The above code has been executed in the browser and the address can be retrieved.
I hope this article will be helpful to everyone's JavaScript programming.