I wanted to know if there is a way to present a new html page using a string containing all the content of the new page I am trying to present, the code is below:
$("#form").on('valid.fndtn.abide', function () {
var data = $(this).serializeArray();
sendAjax('index.php?uc=eventos&a=logView', 'POST', data, function (data) {
try {
var data = jQuery.parseJSON(data);
if (!data.status) {
alertify.error("A hora ou a Data inserida excede a hora e a data corrente! " +
"Você não pode ver resgistros do futuro!");
}
} catch (e) {
document.open();
document.write(data);
document.close();
}
});
});
This document.write(data);
is where I write a new HTML page with the string received from the server, in firefox it works at first but if I update the resulting page it breaks all the formatting and Chrome repeats elements, is not a viable alternative, my question is, within that "date" I have my new html in string as I do to display the same in the browser window without using document.write.
Thanks in advance for your attention and help.