Moving with data from PHP to JS

Notice: This thread is very old.
Pepa Lakosil
Member | 2
+
0
-

Hello,
i need move with some data from PHP into JS.
I use nette.ajax.js so if i want move with data from JS to PHP i call handle function with some data. But i don´t how to do it conversely.
I have following code in my controller

	$this->sendResponse(new JsonResponse(['key' => 'value'])); // simplified

But how to can work with this in JS please?