The main issue for me is that vscode will incorrectly highlight older templates.js syntax inside of an html tag, but that is mostly gone when you use benchpress syntax.
A vscode plugin for highlighting the benchpress braces would be neat 😄
i want write a plugin about watch webtorrent video in nodebb.but when i use these in my chrome browser,it does not work.
$.getScript("https://cdn.jsdelivr.net/webtorrent/latest/webtorrent.min.js");
var wtclient = new WebTorrent();
output show me that
Uncaught ReferenceError: WebTorrent is not defined
at <anonymous>:1:16
the whole code is in my github.
how can i fix this problem?
software version
nodebb: 1.6.1
chrome: 62.0.3202.62
windows 10
node 6.8.0
Classic JS error. You need to provide a callback to getScript
and do everything that depends on WebTorrent in there. Better yet, just use require:
require(['https://cdn.jsdelivr.net/webtorrent/latest/webtorrent.min.js'], function (WebTorrent) {
var wtclient = new WebTorrent();
// etc
});