Can't parse my string into a JSON object in javascript : I am working on a parser for a text file. I am trying to parse some strings into JSON objects so I can easily display some different values on a webapp page (using flask). I am passing the strings into my html page using jinja2, and trying to parse them JSON objects in javascript. 

    <script type="text/javascript">
        function parseLine(x){
        var obj = JSON.parse(x);
        document.write(obj.timestamp1);
    }

I am getting this error: 

SyntaxError: JSON.parse: expected property name or '}' at line 1 column 2 of the JSON data

in the console browser. I have found many stackoverflow questions with that error, but the suggestions do not fix my problem.

If I use a dummy string, surrounded by single quotes: '{"test": "1234"}' it works fine.

If I need to include anymore information I can.