2

I used JQuery.serializeArray() on a form to create an array of objects on a GreaseMonkey application:

[
  {
    name: a
    value: 1
  },
  {
    name: b
    value: 2
  },
  {
    name: c
    value: 3
  },
  {
    name: d
    value: 4
  },
  {
    name: e
    value: 5
  }
]

I need to use GM_xmlhttpRequest to serve these fields back to a server side application. What is the best way to return these fields?

Thanks in advance,

D

Brock Adams
  • 90,639
  • 22
  • 233
  • 295
dkinzer
  • 32,179
  • 12
  • 66
  • 85

1 Answers1

2

I think I found the answer...

I need to use

JSON.stringify(obj)

to turn my serialized fields into a json string. Then I should be able to serve that string to the server as one of the data arguments in a GM_xmlhttpRequest POST request.

dkinzer
  • 32,179
  • 12
  • 66
  • 85