我正在使用jQuery和Ajax构建一个动态网站.我使用History Plugin解决了历史问题和后退按钮.我想在url中传递多个hash like参数,而无需在click事件上重新加载整个页面.我想要的东西:
something.php#type=abc&id=123 要么 something.php/?type=abc&id=123... 哪个可能是在网址中传递和检索此类有点参数的最佳方式?
<a href="#type=abc&id=123">Click</a>
Run Code Online (Sandbox Code Playgroud)
if(type==abc && id==123)
{
do this..
}
Run Code Online (Sandbox Code Playgroud)
通常我们这样做,<a href="something.php?type=abc&id=123">Click</a>但它会重新加载整个页面.