Home > front end > Ajax in the repeat, not repeat submitted
Ajax in the repeat, not repeat submitted
Time:09-17
The code is as follows, only the ajax carried out two times, why?
The function upWord (ln) { The readme (1);//was performed 1 $. Ajax ({ Type: "post", DataType: "json", Url: "upWords? Math="+ math. The random (), Data: { "LN" : LN }, BeforeSend: function (data) { The readme (2);//was carried out 2 times }, }); }
CodePudding user response:
Is it not written request performed twice before?
CodePudding user response:
BeforeSend when once again Send
CodePudding user response:
BeforeSend is ajax requests before the execution of the function, you perform upWord () function is executed after the readme (1), ajax, executed and then perform an ajax request again because beforeSend execute the readme before (2)
CodePudding user response:
BeforeSend: function (data) { In this line of interrupt point https://segmentfault.com/a/1190000022017137