Variable data in ajax call JQUERY

后端 未结 7 1071
有刺的猬
有刺的猬 2020-12-31 14:58

I\'m trying to use variable in AJAX call in jquery but it is not working. move variable contains different values. Please check the following code:

var $move         


        
7条回答
  •  感情败类
    2020-12-31 15:23

    I was looking for something like this. I wanted to have a variable for the key AND a variable for the value.

    let dataPair = {};
    dataPair[dataKey] = dataValue;
    $.ajax({
      url: TheAPIPath,
      data: dataPair,
      method: "GET",
    (etc)
    

提交回复
热议问题