I have JSON data called rowdata that I use in an ajax call. If I use:
JSON.stringify(rowdata)
it looks like like the following:
{"Description":"qwerty","Code":"12345","Size":"11","Colour":"green"}
I do send it to php and use a GET statement (Joomla’s
JRequest::getVar("Description", "", "", "")
statement) to get the elements of rowdata but I cannot succeed.
If I look at the ajax data that has been send I do have the following:
rowdata%5BDescription%5D=qwerty
etc. after applying:
$.param(data)
I have used many version instead of “Description”, but to no avail. I tried to get rowdata on its own and access its elements, but no success. I cannot find out what the %5B and %5D means, searching for that is problematic with the % sign. Anyone who can help to get the values of Description, Code, etc. in php?
You are sending JSON, but trying to parse it as
application/x-www-form-urlencodeddata.Don’t convert the object to JSON.