不刷新页面如何处理查询参数的变化?

huangapple go评论70阅读模式
英文:

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.

huangapple
  • 本文由 发表于 2023年5月23日 00:45:25
  • 转载请务必保留本文链接:https://go.coder-hub.com/76308337.html
匿名

发表评论

匿名网友

:?: :razz: :sad: :evil: :!: :smile: :oops: :grin: :eek: :shock: :???: :cool: :lol: :mad: :twisted: :roll: :wink: :idea: :arrow: :neutral: :cry: :mrgreen:

确定