gatsby_使用Gatsby加载外部JS文件

本文介绍了在Gatsby(一个基于React的静态站点生成器)中如何处理包含外部JavaScript文件的情况,特别是如何在页面加载时添加和管理这些脚本,以实现如Wistia视频嵌入等功能。
摘要由CSDN通过智能技术生成

gatsby

In the modern JavaScript Web Development workflow it’s quite common to install JavaScript via npm packages.

在现代JavaScript Web开发工作流程中,通过npm软件包安装JavaScript是很常见的。

Sometimes however we must include an external JavaScript file, and modern tools might make this a little difficult.

但是有时我们必须包括一个外部JavaScript文件,而现代工具可能会使此操作有些困难。

In particular I had the need to include a video from Wistia in my site, and after a quick look everything looked quite more complicated than I wanted.

特别是,我需要在我的网站中包含来自Wistia的视频,快速浏览后,所有内容看起来都比我想要的复杂得多。

Wistia gave me this HTML snippet to embed:

Wistia给了我这个要嵌入HTML代码段:

<script src="https://fast.wistia.com/embed/medias/VIDEOURL.jsonp" async></script><script src="https://fast.wistia.com/assets/external/E-v1.js" asy
  • 0
    点赞
  • 0
    收藏
    觉得还不错? 一键收藏
  • 0
    评论
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值