SyntaxFix
Write A Post
Hire A Developer
Questions
Use encodeURIComponent() to encode the string.
encodeURIComponent()
Eg.:
var product_list = encodeURIComponent(JSON.stringify(product_list));
You don't need to decode it since the web server automatically do the same.