I'm trying to find a way in javascript to open all external links (or better: all links that normally open in a new window/tab) in a modal box instead.
Essentially I'm looking for a way to attach a listener to external links (that are not targeting the same window) and open them to my modal box instead of opening a new window.
Most ideally it shouldn't matter if a popup is generated by a _blank anchor or by javascript/any other way.
Trying to accomplish this in vanilla javascript.
Thank you so much for your help!
Most of this seems to be like your question:
Opening an external website in a modal popup
The iframe element inside a modal can read the external site, and you could change the src attribute dinamically.
The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.