开发者

how does Google append search parameters to url without reloading page?

开发者 https://www.devze.com 2023-01-18 13:09 出处:网络
How does Google append search parameters to url without reloading page? Does anyone know how they do it? I know about the HASH trick and the webkit pushState function. I don\'t think they are using e

How does Google append search parameters to url without reloading page?

Does anyone know how they do it? I know about the HASH trick and the webkit pushState function. I don't think they are using either.

Their solution is cross browser compati开发者_开发百科ble, do they use a combination of different methods for each browser?


Google uses the hash-trick. Notice that all the parameters are after

http://www.google.com/#

Edit: If you entered the page with other parameters, the # may be further out in the link.


You can add parameters after the hash sign (#) without reloading the page using the window.location.hash property.

0

精彩评论

暂无评论...
验证码 换一张
取 消