Can I read the hash portion of the URL on my server-side application (PHP, Ruby, Python, etc.)?

前端 未结 12 2483
无人及你
无人及你 2020-11-21 04:37

Assuming a URL of:

www.example.com/?val=1#part2

PHP can read the request variables val1 using the GET array.

Is the ha

12条回答
  •  挽巷
    挽巷 (楼主)
    2020-11-21 04:47

    It is retrievable from Javascript - as window.location.hash. From there you could send it to the server with Ajax for example, or encode it and put it into URLs which can then be passed through to the server-side.

提交回复
热议问题