简体   繁体   English

p5.j​​s代码未在Web编辑器中按预期运行

[英]p5.js code doesn't run as expected in web editor

I have already finished my project of building a p5.js weather forecast using OpenWeather's api. 我已经完成了使用OpenWeather的API构建p5.js天气预报的项目。 The code runs perfectly when I open the index.html file. 当我打开index.html文件时,代码可以完美运行。 Why doesn't it display the weather when I run it on the web editor or use it as an iframe on my blog? 为什么在网络编辑器上运行天气或将其用作博客中的iframe时,为什么不显示天气?

github gist github要点

project 项目

you dont have libraries folder uploaded which contains p5 and other libraries. 您没有上载包含p5和其他库的库文件夹。

update your index.html to include those libraries 更新您的index.html以包括这些库

these lines 这些线

<script src="libraries/p5.js" type="text/javascript"></script>
  <script src="libraries/p5.dom.js" type="text/javascript"></script>
  <script src="libraries/p5.sound.js" type="text/javascript"></script>

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM