I loaded some contents by ajax, When i try something like this:
$resp = array(
'success' => true,
'data' => 'the content here'
);
it’s working without any issues but if i used something like this:
$resp = array(
'success' => true,
'data' => get_template_part( 'templates/update', 'profile' )
);
it gives me SyntaxError: JSON.parse: unexpected keyword at line 1 column 1 of the JSON data.
the content here{"success":true,"data":null}
What’s the problem with get_template_part?