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

前端 未结 12 2549
无人及你
无人及你 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 05:03

    What about:

    Dynamically grab the #hash

    
    
    document.writeln(txthash);";
    echo $hash;
    ?>
    

    To make it more fluent:

    Full Example using just Javascript and PHP

    
    
    document.writeln(txthash);";?>
    
    Change to #hash1
    Change to #hash2

提交回复
热议问题