标签: javascript reactjs
我需要从外部 js 文件调用该函数,该文件位于网络中的某个位置,我尝试将其添加到 index.html
index.html
<script type="text/javascript" src="http://.../example.js"></script>
在我的 react js 类 sample.js 中,我想从这个外部 js 文件调用函数 funA,我尝试使用 window.funA(),但它抛出未定义的错误。
sample.js
funA
window.funA()