登录并将 div 部分更改为“welcome $username”
我使用 div 显示用户名/密码/提交
还使用 AJAX 通知“登录无效”而不刷新页面
我需要做的是,
如果登录成功,隐藏用于登录的 div 部分的元素,然后显示“欢迎$username”在同一个 div 中。
(无需重新加载任何页面)
有人可以帮助我吗?
I am using div to display username/password/submit
Also using AJAX to inform "login invalid" without refreshing page
What I need to do is,
If login success, hide the elements of div section that used to log in, then display "welcome $username" in the same div.
(Without any page reloading)
Could anybody help me please?
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(1)
使用 jQuery 的
post
方法:假设
data
仅包含登录用户的用户名。Use jQuery's
post
method:assuming that
data
just contains the logged in users username.