【发布时间】:2019-05-21 04:34:54
【问题描述】:
我正在尝试在 AFrame 上重新加载场景,我有一个带有机器人的场景,当用户单击按钮时我需要加载回场景的原始状态。
我已经尝试过的是:
var sceneElement = document.querySelector("a-scene");
sceneElement.reload();
还有:
location.reload()
第一个在浏览器控制台上引发错误,表明 reload() 方法不是函数,但 AFrame 上的文档支持它。不知道我用对了没有。
Uncaught TypeError: sceneElement.reload is not a function
at HTMLDocument.eval (websim.js:64)
at HTMLButtonElement.eval (editor.js:23)
at HTMLButtonElement.dispatch (jquery.js:4953)
at HTMLButtonElement.elemData.handle (jquery.js:4758)
下面的最后一个代码重新加载整个页面,这不是我需要的。
谢谢! :)
【问题讨论】:
标签: aframe