Node.js 强制页面进入 iframe - 谷歌会抓取它吗?
我有一个脚本,如果博客页面不在我网站的 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 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(1)
据我了解,搜索机器人根本不解释 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?