[英]IntroJS, Uncaught Reference Error
我有一个IntroJS演示,可以在JSFiddle中正常工作。
当我将其与我的应用程序合并时,按钮“单击我以测试IntroJS”返回: Uncaught ReferenceError: intro is not defined at HTMLButtonElement.onclick
<body>
和其他JSfiddle包装器。 之前,我已经将代码段从Codepen移到JSfiddle,并且意识到了通常的错误。 我认为这是一个范围问题,但是我不确定下一步该怎么做。
JS在这里,在第381行
intro = introJs();
intro.setOptions({
'showStepNumbers': false
});
intro.start();
function testAlert() {
alert("alert");
};
该按钮在这里:
<button onclick="intro.start();">Click me to Test IntroJS</button>
完整的应用程序在这里 ,按钮位于一半位置:
codepen示例( https://codepen.io/Teeke/pen/mRgWLg )中的问题是,在355行存在JavaScript错误:
setText(playButton, "Play");
变量playButton尚未定义。 这将阻止其余JavaScript正常工作。 一旦我注释掉对playButton的所有引用,就按预期执行了intro.js代码。
声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.