1👍
You have missed the # selector for id invite of button it should be like $(“#invite”). Use attribute like data-artist instead of just artist and get it like $(“#invite”).data(“artist) or $(“#invite”).attr(“data-artist).
And then post it like ….
var postData = {
csrfmiddlewaretoken: c,
additionalValues: extraData
}
Then post data like
$.ajax({
type: 'post',
url: 'URL here',
data:JSON.stringify(PostData),
// .......
// Other code here
)};
Source:stackexchange.com