Hey I would like to transform this string into JSON:
var newPart = '{\'' + name + '\': {\'content-type\' : ' + type + ', \'content\': ' + content + ',\'type\': \'content\'}}';
The result gives the following string:
{'partHtml': {'content-type' : text/html, 'content': dfg,'type': 'content'}}
I would like to get a JSON object from this string, i tried the following but it fails with the error : "SyntaxError: Unexpected token '"
newPart = JSON.parse(newPart);
I tried without the ' with a few changes but the problem persists.
Thank you for your help.