Answer the question
In order to leave comments, you need to log in
What causes the "unterminated string literal" error?
In general, we have the following picture in one folder:
1. A PHP file that, when requested, "returns" a binary array in JSON format using the json_encode() function; . That is, something like this:
[ { "1": "A", "2": "C", "3": "D"}, { "11": "OLOLO" } ]
<script type="text/javascript">
var CatTheColors = JSON.parse('<?php echo file_get_contents("tot_file_vishe.php"); ?>');
</script>
var CatTheColors = JSON.parse('[
{
"1": "A",
"2": "C",
"3": "D",
},
{
"11": "OLOLO"
}
]');
Answer the question
In order to leave comments, you need to log in
Didn't find what you were looking for?
Ask your questionAsk a Question
731 491 924 answers to any question