2
DomReady.ready(function() {
    (function () {
        var Username = document.getElementById("Username").onpaste = function() {Username()};

        function Username(){
            alert("Boom");
        }

    })();
});

I am getting too much recursion error in console. I don't know how to debug it, so if any one can point me out on how to debug it then it will be helpful.

I am getting too much recursion error in console. I don't know how to debug it, so if any one can point me out on how to debug it then it will be helpful.

uladzimir
  • 5,639
  • 6
  • 31
  • 50
Himanshu
  • 37
  • 5
  • 1
    You could have removed the styles part as it is irrelevant. – Ananth Dec 07 '14 at 15:39
  • check out this: [function-and-variable-with-the-same-name](http://stackoverflow.com/questions/15057649/function-and-variable-with-the-same-name) – abl Dec 07 '14 at 15:47
  • @Ananth I am sorry. I will keep that in mind next time. @ abl Thank you – Himanshu Dec 07 '14 at 17:28

1 Answers1

2

Try something like this:

DomReady.ready(function() {
    document.getElementById("Username").onpaste = username;

    function username(){
        alert("Boom");
    }
});
uladzimir
  • 5,639
  • 6
  • 31
  • 50