重写 url ala Google Instant? [英] Rewrite url ala Google Instant?

查看:29
本文介绍了重写 url ala Google Instant?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我有一个用 Ajax 和 Js 构建的电子商务网站,当用户输入搜索关键字时,列表会通过 ajax 拉出,但浏览器 url 在我的情况下不会改变,所以如果用户重新加载或只是添加书签他必须从头开始丢失关键字输入的地址.

I have a e-commerce website built in Ajax and Js, when the user type a search keyword the list is pulled via ajax but the browser url, in my case doesn't change, so if the user reaload or simply bookmarks the address he 'll have to start form scratch loosing the keywords input.

我注意到 Google 用完整的查询重写了 url,没有标签或复杂的解决方法......显然

i noticed Google instead rewrites the url with the complete query, no hashtag or complex workaround...apparently

我怎样才能做到这一点?考虑到我可以完全控制我的服务器,所以我可以按照我想要的任何方式设置我的 apache.

how can i achieve that? consider i have complete control on my server so i can set my apache in any way i want.

谢谢!!

推荐答案

我不确定您使用的是什么浏览器,但我在 Chrome 中的主题标签后获得了所有搜索词(例如,http://www.google.com/#sclient=psy&hl=en&q=test+test+sibilance&aq=3&...).我不认为你认为正在发生的事情实际上正在发生.它可以在 Chrome 和其他 HTML5 浏览器上使用 history.pushState() 完成,但我没有看到使用该方法的 Google Instant.

I'm not sure what browser you're using, but I get all the search terms after a hashtag in Chrome (e.g., http://www.google.com/#sclient=psy&hl=en&q=test+test+sibilance&aq=3&...). I don't think what you think is occurring is actually happening. It could be done on Chrome and other HTML5 browsers using history.pushState(), but I don't see Google Instant using that method.

这篇关于重写 url ala Google Instant?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆