jQuery ui 对话框在加载回调后更改标题
我喜欢在 UI 对话框中提交表单后更改 UI 对话框的标题。因此,在 load
之后的回调函数中,我应该建议,但我已经尝试并用谷歌搜索,但没有结果。
有人有想法吗?
I like to change the title from an UI Dialog after i have submitted a form in this UI Dialog. So in the callback-function after load
i should suggest, but i've tried and googled without result.
Has anyone an idea?
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(5)
使用对话框方法:
或者直接,尽管很hacky:
为了将来的参考,您可以使用 jQuery 跳过 google。 jQuery API 大多数时候都会回答您的问题。在本例中,为对话框 API 页面。对于主库: http://api.jquery.com
Using dialog methods:
Or directly, hacky though:
For future reference, you can skip google with jQuery. The jQuery API will answer your questions most of the time. In this case, the Dialog API page. For the main library: http://api.jquery.com
我找到了更简单的解决方案:
希望有帮助!
I have found simpler solution:
Hope that helps!
Nick Craver 的 hacky 想法的增强,将自定义 HTML 放入 jquery 对话框标题中:
An enhancement of the hacky idea by Nick Craver to put custom HTML in a jquery dialog title:
我尝试实现尼克的结果:
但这对我不起作用,因为我在一页上有多个对话框。在这种情况下,它只会在第一次时将标题设置正确。尝试装订命令不起作用:
我通过将标题添加到页面上每个对话框的 javascript 函数参数来修复此问题:
I tried to implement the result of Nick which is:
But that didn't work for me because i had multiple dialogs on 1 page. In such a situation it will only set the title correct the first time. Trying to staple commands did not work:
I fixed this by adding the title to the javascript function arguments of each dialog on the page:
甚至更好!
Even better!