Answer the question
In order to leave comments, you need to log in
For what reason does the layout break?
Good afternoon, maybe someone came across, my layout breaks when passing an array from php to js using json. The banner breaks, which adjusts to the height of the screen. It begins to stretch down to not normal sizes, and the variables do not intersect anywhere. I don't understand where the ambush can be (
$var = ['a'=>1,'b'=>'2'];
$var = json_encode($var);
?>
<script>
let abcd = JSON.parse('<?= $var?>');
console.log(abcd);
</script>
Answer the question
In order to leave comments, you need to log in
There is such an amazing tool. It's called debugger\debugger and is invoked with F12 in most browsers. It is he who will help you, and so it will be an attempt to play vanga.
Nevertheless, Asinguyu, most likely you have data somewhere or an error in the code that you somehow can’t see with your eyes, you can catch this or another bug with the debugger.
Didn't find what you were looking for?
Ask your questionAsk a Question
731 491 924 answers to any question