1

The following throws "JavaScript runtime error: Invalid character":

   var opts = "[{'UOM':'E','Description':'E - Each'},{'UOM':'C','Description':'C - Per 100'},{'UOM':'M','Description':'M - Per 1000'}]"
   var options = JSON.parse(opts);

What invalid character is in my JSON string? Thanks

BoundForGlory
  • 4,114
  • 15
  • 54
  • 81

1 Answers1

3

You need to replace the apostrophes with escaped quotation marks (\").

Thriggle
  • 7,009
  • 2
  • 26
  • 37