search

Home  >  Q&A  >  body text

javascript - Can a form generate a hash when submitted? Pure front-end

Now there is a form tag on the page, action="http://www.a.com", using get
Generally, the URL after we submit will be generated as "http://www.a. com?balbalbal"
Now I want to generate it as "http://www.a.com#balbalbal"
Change the search to hash.
Can it be achieved without using js?
Don’t want to use the window.open method

扔个三星炸死你扔个三星炸死你2772 days ago953

reply all(2)I'll reply

  • 欧阳克

    欧阳克2017-06-21 10:14:50

    Pure front-end, no js, ​​these two restrictions are too severe, it can be achieved by removing any one of the conditions.

    reply
    0
  • 仅有的幸福

    仅有的幸福2017-06-21 10:14:50

    Set anchor point, name attribute

    reply
    0
  • Cancelreply