Skip to content

Instantly share code, notes, and snippets.

@gtempesta
Last active April 11, 2019 16:21
Show Gist options
  • Save gtempesta/5c9922cea082b2fc34cc308d576646b5 to your computer and use it in GitHub Desktop.
Save gtempesta/5c9922cea082b2fc34cc308d576646b5 to your computer and use it in GitHub Desktop.
Turn URL parameter into hash
<script>
// use the `anchor` parameter to change the hash
var newHash = "<?php echo $_GET['anchor']; ?>";
window.location.hash = newHash;
</script>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment