所以我在 Browserify 中遇到了这种奇怪的情况,即使我的函数在全局范围内运行,控制台仍然显示:
Uncaught ReferenceError: testing is not defined
at HTMLButtonElement.onclick (signUp.html:86)
如您所见,我为此波纹管制作了一个测试脚本:
预浏览构建
Window.testing = function()
{
console.log('this executed');
}
尽管它在全球范围内,但它尚未起作用。 100% 确定正确的目录和文件包含在 html 中。我在 html 中使用该函数如下:
<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.--->
我很困惑?我做错了什么?