我有
var data = decodeURIComponent($(this).attr("name"));
var数据的输出是
ldef_index[]=5&lquality[]=0&id[]=&rdef_index[]=315&rquality[]=0&rdef_index[]=7115&rquality[]=0&rdef_index[]=50&rquality[]=0&rdef_index[]=55&rquality[]=0&rdef_index[]=5086&rquality[]=0&rdef_index[]=711&rquality[]=0&rdef_index[]=3229&rquality[]=0&rdef_index[]=7555&rquality[]=0&tslt=c9942¬es=test
如何将此变量转换为在jquery ajax请求中将其作为数据发送?
$.ajax({
type : "POST",
url : 'https://example.com/ajax/test.php',
data: { ldef_index[]: 5,
lquality[]: 0,
id[]= ,
rdef_index[]: 315,
rquality[]: 0,
rdef_index[]: 7115,
rquality[]: 0,
rdef_index[]: 50,
rquality[]: 0,
rdef_index[]: 55,
rquality[]: 0,
rdef_index[]: 5086,
rquality[]: 0,
rdef_index[]: 711,
rquality[]: 0,
rdef_index[]: 3229,
rquality[]: 0,
rdef_index[]: 7555,
rquality[]: 0,
tslt: c9942,
notes: test },
});