Show rendered node in jQuery modal through JSON
I can suggest you to check with AjaxResponse, it will return the json response object.

$response = new AjaxResponse();


And use below to open content in modal or as dialog.

$response-&gt;addCommand(new OpenModalDialogCommand($title, $content, ['width' =&gt; '700'])); // To open a modal window


OR

$response-&gt;addCommand(new OpenDialogCommand('#some-element', $title, $content, ['width' =&gt; '700'])); // to open a dialog window


$title refers to title of your node and $content refers to content that you want to show in the modal. It is also possible to define some properties like width in it.

And in the end just return it's response like below:

return $response;


Remember to include AjaxResponse in it your controller file.

use Drupal\Core\Ajax\AjaxResponse;


I hope the above will solve your problem.