Javascript 如何在iFrame中禁用/防止重定向?
我们有以下两个iFrame:Javascript 如何在iFrame中禁用/防止重定向?,javascript,html,iframe,ejs,embed,Javascript,Html,Iframe,Ejs,Embed,我们有以下两个iFrame: <iframe width="560" height="315" src="https://www.youtube.com/embed/DmiMpABb804" title="YouTube video player" frameborder="0" allow="accelerometer; autoplay; clipboard-write; en
<iframe width="560" height="315" src="https://www.youtube.com/embed/DmiMpABb804" title="YouTube video player" frameborder="0" allow="accelerometer; autoplay; clipboard-write; encrypted-media; gyroscope; picture-in-picture" allowfullscreen></iframe>
YouTube iFrame的左下角有“在YouTube上观看”。这会将用户重定向到YouTube
Spotify iFrame的右上角有一个“Spotify徽标”,用于将用户重定向到Spotify
我们的目标:当用户点击/轻触其中任何一个时,都不会发生任何事情。
在此处直接打开嵌入式播放器:
<iframe src="https://open.spotify.com/embed/track/39LLxExYz6ewLAcYrzQQyP" width="300" height="380" frameborder="0" allowtransparency="true" allow="encrypted-media"></iframe>