I'm trying to return some code snippets from php to jquery. Everything works ok, but when I try to return html with <body>
and <html>
tags then I get my javascript code in output (raw code)
this is my code:
$snippetData['snippetId'][] = $snippetId;
$snippetData['title'][] = $title;
$snippetData['description'][] = $description;
$snippetData['snippet'][] = $code;
echo json_encode($snippetData);
EDIT:
To make it more clear this is what I store in this array:
snippedId = 5 (integer value)
title = 'some title' (string value)
description 'some description' (string value)
snippet = '<html> <body> <title>some title </title> </body> </html>' (string value)