Node.js 强制页面进入 iframe - 谷歌会抓取它吗?

发布于 2024-09-13 04:30:47 字数 421 浏览 4 评论 0原文

我有一个脚本,如果博客页面不在我网站的 iframe 中,它会重新加载博客页面。这会干扰搜索引擎抓取博客吗?

我的直觉告诉我,这个脚本不会阻止博客被抓取,但它会干扰搜索引擎生成的任何结果链接,因为这些链接会将带有 js 的用户转储到博客的“顶层”博客,而不是他们想要的页面。要解决这个问题需要一些花哨的饼干工作。

<script type="text/javascript">
 if (self.location == top.location && location.search.substring(1) != 'nf')
 top.location.href = 'http://www.parentSite.co.uk/cms/section/iframe/'
</script>

你们说什么?

I have a script that reloads a blog page if its not in an iframe on my site. Will this interfere with search engines crawling the blog?

My gut says that this script won't keep the blog from being crawled, but it will interfere with any resulting links generated by search engines as following them, as these links will dump the user with js, into the 'top level' of the blog, and not the page they were after. To solve this would require some fancy cookie work.

<script type="text/javascript">
 if (self.location == top.location && location.search.substring(1) != 'nf')
 top.location.href = 'http://www.parentSite.co.uk/cms/section/iframe/'
</script>

what say ye?

如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

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

发布评论

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

评论(1

や三分注定 2024-09-20 04:30:47

据我了解,搜索机器人根本不解释 JavaScript,所以我认为这很好。

虽然我不确定你为什么要这样做。看起来它会极大地干扰用户的体验。有没有办法可以将你想要的内容加载到父页面的iframe中?也许在查询字符串中使用此 nf 参数?

Search bots, as I understand it, do not interpret JavaScript at all, so I think that's fine.

Although I'm not sure why you'd want to do this. It seems as though it would interfere with your users' experience quite a bit. Is there no way that you can load the content you want into the iframe on the parent page? perhaps with this nf parameter in your query string?

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