Monday, October 27, 2014

Javascript to get hash value from URL

<script type="text/javascript">
            var hashId = window.location.hash;
            hashId = hashId.match(/#[^?&\/]*/g);
<script>

sample input: www.domain.com/#anchorlink?firstname=mark

result: #anchorlink

1 comment: