Ajax submit parameters


When making Ajax request, we need to pass URL address / parameter / callback function, and other contents

There are two ways to submit Ajax parameters:

  1. $. Post (“URL”, {K: V, K: v…}, callback function)
  2. $. Post (“URL”, k = V & K = V,…, callback function)

However, if a large number of parameters to be passed are provided in the form, it is not convenient to write them one by one,

JQuery providesserialize()Function to encapsulate the entire form in the format of k = V & K = v