AJAX SEO(re:带有URL散列状态的分面搜索)

时间:2022-08-25 19:30:01

I'm reusing an AJAX faceted search framework I wrote for a previous website, which is all AJAX and stores the page state (for browser back button support) in the URL's hash. You can see it in action here w/ something like this:

我正在重复使用我为以前的网站编写的AJAX分面搜索框架,它是所有AJAX并在URL的哈希中存储页面状态(用于浏览器后退按钮支持)。你可以在这里看到它有这样的事情:

http://www.carnegiefabrics.com/productsearch.aspx#v={-f-.{-Usage-.[653]-Color-.[902]}-p-.1_-s-.--}

http://www.carnegiefabrics.com/productsearch.aspx#v={-f-.{-Usage-.[653]-Color-.[902]}-p-.1_-s-.--}

In this new project I want the contents to be able to be crawled by search engines, so I need the results to render w/o JavaScript -- that is, by the server.

在这个新项目中,我希望内容能够被搜索引擎抓取,所以我需要结果来呈现无JavaScript - 即服务器。

NOTE: I don't want to use Google's hash solution (using the '!') because it's too magical and it's Google-only.

注意:我不想使用谷歌的哈希解决方案(使用'!'),因为它太神奇了,只有谷歌。

I'm thinking of having the initial page load (which will have all facets set to "all") render ALL of the results directly from the server. SE will then be able to crawl them. Then, I'll strip the extra results (anything above what should be on page 1) via JavaScript. This will correct the UI for the user, and everything will be AJAX from here.

我正在考虑将初始页面加载(将所有方面设置为“all”)直接从服务器呈现所有结果。然后,SE将能够抓取它们。然后,我将通过JavaScript删除额外的结果(超出第1页应该是什么)。这将纠正用户的UI,一切都将是AJAX。

It's a little awkward, but it's the best solution I have currently. What are people's thoughts/suggestions on this approach?

这有点尴尬,但这是我目前最好的解决方案。人们对这种方法的想法/建议是什么?

1 个解决方案

#1


1  

In this new project I want the contents to be able to be crawled by search engines, so I need the results to render w/o JavaScript -- that is, by the server.

在这个新项目中,我希望内容能够被搜索引擎抓取,所以我需要结果来呈现无JavaScript - 即服务器。

It is impossible to do it without JavaScript. The hash part of the url is not sent to the server. So the server is not able to read it. That is why this model stinks.

没有JavaScript就不可能做到这一点。 url的哈希部分不会发送到服务器。所以服务器无法读取它。这就是为什么这个模型很臭的原因。

What are people's thoughts/suggestions on this approach?

人们对这种方法的想法/建议是什么?

In browsers that support HTML5, you should use The new History methods to control the browser state which allows you to generate a hashless url!

在支持HTML5的浏览器中,您应该使用新的History方法来控制浏览器状态,从而允许您生成无哈希的URL!

#1


1  

In this new project I want the contents to be able to be crawled by search engines, so I need the results to render w/o JavaScript -- that is, by the server.

在这个新项目中,我希望内容能够被搜索引擎抓取,所以我需要结果来呈现无JavaScript - 即服务器。

It is impossible to do it without JavaScript. The hash part of the url is not sent to the server. So the server is not able to read it. That is why this model stinks.

没有JavaScript就不可能做到这一点。 url的哈希部分不会发送到服务器。所以服务器无法读取它。这就是为什么这个模型很臭的原因。

What are people's thoughts/suggestions on this approach?

人们对这种方法的想法/建议是什么?

In browsers that support HTML5, you should use The new History methods to control the browser state which allows you to generate a hashless url!

在支持HTML5的浏览器中,您应该使用新的History方法来控制浏览器状态,从而允许您生成无哈希的URL!