I have a url that returns JSON, but the beginning of the return string is
])}while(1);</x>{"success":true,"payload":{"value":
I want to split on ])}while(1);</x>
and look at the [1] value of the that split
array.
Right now I'm doing
fetch(jsonURL)
.then(res => {
console.log(res);
});
Normally I'd split at the console.log
but I'm getting the following error:
the-myth-of-the-genius-programmer-9381a884591e:1 Uncaught (in promise) SyntaxError: Unexpected token ] in JSON at position 0