是否可以在不更改页面的情况下打开外部 URL - 类似于那些 javascript 图像查看器弹出窗口
我想在我的网站上托管一些图像,并让人们向它们发布 URL。 但是,我不希望人们必须被重定向到我的网站才能查看它们。 有没有什么方法可以设置我的网站,以便无论 URL 发布在哪里,它都会在不更改页面的情况下打开? 看起来与光刻相似?
I'd like to host some images on my website and let people post URL's to them. However, I don't want people to have to be redirected to my website to view them. Is there some way to setup my site so that no matter where the URL is posted, it will open up without changing pages? Similar looking to lightscribe?
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(2)
如果人们只是发布指向您网站的链接(例如
),那么您在
example.com
上无能为力以防止他们离开引用页面。您可以提供一段代码来创建类似灯箱的效果,并鼓励用户使用它而不是 URL。 例如,YouTube 提供了一段 HTML 来创建嵌入式播放器。
If people are simply posting links to your site like
<a href="http://example.com">
, there's nothing you can do onexample.com
to prevent them from leaving the referring page.You could provide a piece of code that will create a lightbox-like effect and encourage your users to use it instead of the URL. Like YouTube, for example, which provides a chunk of HTML that creates an embedded player.
您可以尝试使用 bookmarklet 类型的链接。 但是你需要一点 JS 经验才能做到这一点,尽管这确实可以做到。
You may try using bookmarklet type links. But you need a bit JS experience for this, though it sure can be done.