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

前端 未结 12 2518
无人及你
无人及你 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:59

    Th part of an URI after the # is called "fragment" and is by definition only available/processed on client side (see https://en.wikipedia.org/wiki/Fragment_identifier).

    On the client side, this can be accessed using javaScript with window.location.hash.

提交回复
热议问题