When sending a request you should properly URL encode parameteres:
$.ajax({
url: 'foo.php',
data: { html: '<html>You can use whatever characters you want here</html>' },
type: 'GET',
success: function(result) {
}
});
or:
$.ajax({
url: 'foo.php',
data: { html: $('#someTextFieldWhichMightContainHtml').val() },
type: 'GET',
success: function(result) {
}
});
Now you can safely read the html variable in your PHP script: $.GET["html"].
I suppose that right now your code looks something like this:
$.ajax({
url: 'foo.php?html=' + $('#someTextField').val(),
type: 'GET',
success: function(result) {
}
});
I would recommend you to never use string concatenations and always use the data hash.