changing page url without refreshing page

后端 未结 3 2004
耶瑟儿~
耶瑟儿~ 2021-01-01 07:35

Is this even possible?

Here\'s the problem:

I have a keyword search with this URL(after searching) : http://localhost/thi/search?keyword=key

Then I h

3条回答
  •  既然无缘
    2021-01-01 08:26

    You can use hash urls (search#price=100) with window.location.hash methods. These will get bookmarked and user can navigate through these with back and forward buttons.

    Usage sample:

    100
    
    $('a').click(function() {
        window.location.hash = 'price='+$(this).html();
        return false;
    });
    

    Will set the url to search#price=100 without refreshing.

提交回复
热议问题