Home  >  Q&A  >  body text

show() is invalid after ajax success


The console can print login success and 222, but the element always flashes on the page and disappears. What's going on?

PHP中文网PHP中文网2710 days ago509

reply all(3)I'll reply

  • 给我你的怀抱

    给我你的怀抱2017-05-19 10:42:54

    When there is a button tag in the form, and the form is submitted asynchronously using ajax, the page will be refreshed
    Reason: When the button exists, the form will be submitted again, so the page is refreshed
    Solution: Just replace the button tag with an a tag

    reply
    0
  • 伊谢尔伦

    伊谢尔伦2017-05-19 10:42:54

    Either your selector did not select the right one, or other Js is interfering at the same time

    reply
    0
  • 大家讲道理

    大家讲道理2017-05-19 10:42:54

    Probably covered. You can find out by turning on debugging and looking at the style of the right element.

    reply
    0
  • Cancelreply