Browserify Window Function Is Undefined

  browserify, global, javascript, node.js

So I had this strange occurrence with Browserify where even if my functions were made to function in the global scope, the console still shows:

Uncaught ReferenceError: testing is not defined
    at HTMLButtonElement.onclick (signUp.html:86)

As you can see, I made a testing script for this bellow:

Pre-Browserify Build

Window.testing = function()
{
    console.log('this executed');
}

and it is yet to work despite it being in the global scope. Take this with 100% certainty also that the correct directory and file is included into the html. I am using the function within the html as follows:

        <div class="col-md-12 section-heading text-center to-animate">
                        
                                
            <button onclick="testing()">Generate Key For a New Wallet<button>
            <br>

<!---Etc.Etc.Etc.--->

I am confused? What am I doing wrong?

Source: Ask Javascript Questions

LEAVE A COMMENT