javascript – 取得網址的hash,也就是#後方的文字
1 2 3 4 5 6 7 |
<script> //取得網址的hash,例如取得http://XXX.tw/#type var hash = window.location.hash.substring(1); alert(hash); //輸出type </script> |
偷懶是程設師的美德
1 2 3 4 5 6 7 |
<script> //取得網址的hash,例如取得http://XXX.tw/#type var hash = window.location.hash.substring(1); alert(hash); //輸出type </script> |