onsubmit后触发Jquery事件
我想在表单完成操作后触发 Div 打开。但我只需要它基于一个特定的操作发生,所以它是特定的。我不知道从哪里开始。
I would like to trigger a Div to open after a form completes an action. But I need to it only happen based on one particular action so it is specific. I'm not sure where to start.
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(1)
好的,如果您的表单完成操作(即您已提交)后未加载新页面,我会假设您的意思是您没有将用户重定向到其他页面;您只是用更新的数据发回当前的“购物车”页面。
所以你的问题是,“如何仅在回发后在我的页面上显示内容”。
虽然 jQuery 可以完成所有事情,但这里可能不需要(如果至少我已经正确解释了你的问题)。
您只需要检查页面是第一次加载还是为了响应回发而加载。为此,您可以使用
Page.IsPostBack
属性:如果这不是您的意思,您需要进一步解释您的问题。
Ok, so if a new page is not loaded after your form completes an action (i.e. you have submitted it), I would assume you mean you're not redirecting the user to a different page; you're just posting back the current "Cart" page with the updated data.
So your question is, "How do I display content on my page only following a postback".
While jQuery does all things, it's probably not needed here (if I've interpreted your problem correctly, at least).
You just need to check whether the page is being loaded for the first time or is being loaded in response to a postback. For that you use the
Page.IsPostBack
property:If this isn't what you meant, you need to explain your question a bit more.