2

I'm trying to trigger an event by clicking an external link from an email using the jquery/javascript window.location.hash. Unfortunately the app is built with angular and has a hash in the url initially https://www.electricstudio.ph/#/

I even tried adding the hash manually but the functionality doesn't seem to trigger. https://www.electricstudio.ph/#/

function slideSignUp() {
    $('.header-form-container.signup').addClass('active');
}

$(document).ready(function() {
  if (window.location.hash == '#sign-up') {
        console.log('PING');
  }
});

1 Answer 1

3

This usually works for me:

$(window).on('hashchange', function () {
    hashUrl = window.location.hash;
    if (hashUrl == "#sign-up") {
         console.log('PING');
    }
});
Sign up to request clarification or add additional context in comments.

Comments

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.