Import js from script tag in HTML file. Possible?

前端 未结 3 482
抹茶落季
抹茶落季 2021-01-12 06:09

I want to access data from script tag in html file, produced by cms. Is it possible to do this without polluting global namespace? I\'ve tried to use es6 modules but I\'ve

3条回答
  •  青春惊慌失措
    2021-01-12 06:27

    You can't export JS from HTML. You can import it however, using the type="module" attribute on the

提交回复
热议问题