Vaadin22 不返回表达式的值

发布于 2025-01-16 19:53:04 字数 218 浏览 5 评论 0原文

当我调用 UI.getCurrent().getPage().executeJs("document.getElementById("test").scrollTop") PendingJavaScriptResult 始终返回 null。错误处理程序不会给出任何错误。当我在浏览器的控制台中执行 javascript 时,一切正常。

我在这里做错了什么?

When i call UI.getCurrent().getPage().executeJs("document.getElementById("test").scrollTop")
the PendingJavaScriptResult always returns null. No error is given through the error handler. When i execute the javascript in the console of the browser everything works fine.

What am i doing wrong here?

如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

扫码二维码加入Web技术交流群

发布评论

需要 登录 才能够评论, 你可以免费 注册 一个本站的账号。

评论(1

最舍不得你 2025-01-23 19:53:04

您应该将 "return document.getElementById("test").scrollTop" 作为 JavaScript 表达式。否则你什么也没有返回。

You should have "return document.getElementById("test").scrollTop" as the JavaScript expression. Otherwise you're just returning nothing.

~没有更多了~
我们使用 Cookies 和其他技术来定制您的体验包括您的登录状态等。通过阅读我们的 隐私政策 了解更多相关信息。 单击 接受 或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
原文