search

Home  >  Q&A  >  body text

javascript - ajax submit duplication using interface form

Submit data asynchronously through ajax in the form of interface on the PC side. This data is some input and pictures. Here I do not use the form form to submit, but simply obtain the value, and then put the value in the form that needs to be submitted. The corresponding fields of the interface are submitted successfully for the first time without any problem. But each time the next submission is made, the previous data will be submitted repeatedly, and not all of the previous data is resubmitted, but some of it is from the previous time. Some of them are not known or recognized. Just a string of question marks

大家讲道理大家讲道理2781 days ago590

reply all(5)I'll reply

  • 大家讲道理

    大家讲道理2017-05-19 10:17:20

    Post code pictures, think about a few questions first

    1.是不是使用了什么框架。原生的还是什么
    2.提交的数据是不是一个对象,对象是不是没有清空。
    3.是不是事件有问题。形成了闭包导致数据异常?

    reply
    0
  • 为情所困

    为情所困2017-05-19 10:17:20

    I agree with the answerer on the 1st floor, I suggest you post the code;
    For jquery’s ajax, you can try the disable cache option, cache:false.

    reply
    0
  • 过去多啦不再A梦

    过去多啦不再A梦2017-05-19 10:17:20

    Just watch the network

    reply
    0
  • 滿天的星座

    滿天的星座2017-05-19 10:17:20

    It is recommended to check the network to see if the data submitted each time meets the requirements, or output the content to be submitted before submitting again

    reply
    0
  • 滿天的星座

    滿天的星座2017-05-19 10:17:20

    Before asking questions, check your own code first and debug your own code. I believe you can solve this problem yourself.

    reply
    0
  • Cancelreply