$.ajax
will parse the incoming JSON for you, so the response
variable in your success callback has already been parsed into a JS object when you receive it.
From the documentation of jQuery.ajax on when using "json" as datatype:
Evaluates the response as JSON and returns a JavaScript object. The
JSON data is parsed in a strict manner; any malformed JSON is rejected
and a parse error is thrown. As of jQuery 1.9, an empty response is
also rejected; the server should return a response of null or {}
instead.
Remove JSON.parse
and read the data from your response variable directly, and you should be all good.
success: function (response) {
$('#myJson').html('<table style="color:red"><tr><td>' + response.color1 + '</td><td>' + response.color2 + '</td></tr></table>');
}