Skip to content

Instantly share code, notes, and snippets.

What would you like to do?
function isValid(url) {
return /^http(s)?:\/\/[0-9a-z.-]+\$/gi.test(url);
var url = window.location.hash.substr(1);
if (isValid(url)) {
window.location = url;
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
You can’t perform that action at this time.