英文:
How not to refresh the page when query parameters change?
问题
有一个Unity WebGL应用程序在页面上。当页面参数更改时,您需要调用特定函数,但不要更新它,以便更改仅影响应用程序。这是否可能?
我正在尝试查找相关信息,然后遇到了ajax,但似乎不是我需要的东西。我找不到更多信息。
英文:
There is a Unity WebGL application on the page. You need to call a certain function when a page parameter changes, but not to update it, so that the changes only affect the application. Is this even possible?
I was trying to find information on this and came across ajax, but it didn't seem to me to be quite what I needed. I couldn't find any more information.
答案1
得分: 1
用户在浏览器中输入地址并加载新页面(即使是同一页)是在Web应用程序之外发生的操作。你无法阻止它。
你能做的最接近的操作是警告用户他们正在离开你的应用程序,并提供他们取消导航的机会。他们不一定要接受。
英文:
The user entering an address into their browser and loading a new page (even if is the same page) is an operation that happens outside of the web application. You cannot prevent it.
The closest you could come would be to warn the user that they are leaving your app and offer them the opportunity to cancel navigation. They do not have to take it.
通过集体智慧和协作来改善编程学习和解决问题的方式。致力于成为全球开发者共同参与的知识库,让每个人都能够通过互相帮助和分享经验来进步。
评论