Even my code works to pass value with ajax.I still want to transform data to json type then pass it to ajax,like this:
{"name":"test"}
and now data is like this below:
var data = {
'name': $("#name").val()
}
how can I get json? thank you for your answer!