a = JSON.parse('["<input class="image" type="file" name="%simg_%d"/>"]');
gives the above error. Can someone explain why? Is %s
the start of some kind of special character string in json/javascript?
You don't escape the quotes so you keep breaking in and out of the string which makes for invalid JSON
JSON.parse('["<input class=\\"image\\" type=\\"file\\" name=\\"%simg_%d\\"/>"]');