0
this.testing = function(link) {
        window.location = link;
        window.addEventListener('load', function() {
            alert("It's loaded!");
        });
        //OR
        myFunctionCall()
    }

This is the code I'm trying to implement but after the window is redirected to a link Im not getting the alert.

My aim is to call a function which is dependent on the window after getting redirected

Dhruvit
  • 1
  • 2
  • This will resolve your issue: https://stackoverflow.com/questions/21875390/redirect-page-and-call-javascript-function – Abu Sufian Dec 28 '20 at 07:11
  • @AbuSufian Yes this does work when written on javascript files. But while writing it in snippets as soon as a wondow is getting redirected to new link next steps in the code are not getting executed – Dhruvit Dec 28 '20 at 13:21

0 Answers0