如何在react中包含外部javascript [英] how to include external javascript in react

查看:53
本文介绍了如何在react中包含外部javascript的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

在html页面中,您可以通过<script src="path"></script>包含一个javascript文件 如果路径是例如,如何从外部路径中像这样在反应中获取变量: <script src="https://unpkg.com/flux-sdk-helpers@0.1/dist/flux-sdk-helpers.min.js"></script>

In an html page you can include a javascript file by <script src="path"></script> How do you get variables from an external path like this in react, if the path is, for example: <script src="https://unpkg.com/flux-sdk-helpers@0.1/dist/flux-sdk-helpers.min.js"></script>

感谢您的所有帮助

推荐答案

您可以将其链接到index.html文件中,只是在执行操作时要注意所称的内容,以免在其他地方重复使用名称

you can link it in your index.html file just be careful about what you call things when you are doing it as to not re use names in different places

这篇关于如何在react中包含外部javascript的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆