是否可以在不更改页面的情况下打开外部 URL - 类似于那些 javascript 图像查看器弹出窗口

发布于 2024-07-30 11:28:48 字数 125 浏览 1 评论 0原文

我想在我的网站上托管一些图像,并让人们向它们发布 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 技术交流群。

扫码二维码加入Web技术交流群

发布评论

需要 登录 才能够评论, 你可以免费 注册 一个本站的账号。

评论(2

堇色安年 2024-08-06 11:28:49

如果人们只是发布指向您网站的链接(例如 ),那么您在 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 on example.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.

裂开嘴轻声笑有多痛 2024-08-06 11:28:49

您可以尝试使用 bookmarklet 类型的链接。 但是你需要一点 JS 经验才能做到这一点,尽管这确实可以做到。

You may try using bookmarklet type links. But you need a bit JS experience for this, though it sure can be done.

~没有更多了~
我们使用 Cookies 和其他技术来定制您的体验包括您的登录状态等。通过阅读我们的 隐私政策 了解更多相关信息。 单击 接受 或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
原文