grails,jquery 事件处理程序绑定到由remoteFunction 或remoteLink 进行的元素更新
在remoteFunction 和remoteLink 标签中,我们可以列出要随服务器响应更新的元素映射。当调用完成后,这些元素将被更新。
使用 jquery,哪个事件处理程序可以绑定到元素来确定元素已发生更新?
谢谢
In the remoteFunction and remoteLink tags one can list a map of elements to update with the server response. When the call is done, these elements will be updated.
Using jquery, which event handler can one bind to the element(s) to determine that an update to the element has occurred?
Thanks
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(1)
为什么不直接使用 g:remoteFunction 的 onComplete 属性呢?无论您在remoteFunction 或remoteLink 标记的onComplete 属性中指定什么javascript,都将在请求完成和更新完成后执行。然后,您可以放入该函数来进行所需的 jQuery 调用。
如果您需要知道成功或失败,您可以使用标记的 onSuccess 或 onFailure 属性。
有关详细信息,请参阅 grails 文档中的此页面: http://grails.org/ doc/latest/ref/Tags/remoteFunction.html
Why not just use the onComplete attribute of g:remoteFunction? Whatever javascript you specify in the onComplete attribute of the remoteFunction or remoteLink tag will be executed upon completion of the request and updates being finished. You can then put in that function to make the jQuery calls you want
If you need to know success or failure, you could use the onSuccess or onFailure attributes of the tag.
See this page in the grails docs for more info: http://grails.org/doc/latest/ref/Tags/remoteFunction.html