0
I’m making a system, more precisely, a code editor HTML and CSS online, where I need to send two fields via POST
to a php page, which will process the data and save it in a random name html file, generated at each page update.
So far so good, I’m sending this data via AJAX
to prevent the page from giving refresh and the file name changes.
On the same page is a iframe
which refers to the created html page, only when sending the data via AJAX
and save in html file, I should give a reload
in the iframe
to update the file to which it refers, in this way:
document.getElementById("myIframe").contentWindow.location.reload();
The problem is there, time to give the reload
in the iframe
, the whole page is updated (I say this because the upload icon appears as in the image below.)
Which brings about the generation of a new file name, which, as I said, every page update a new name is generated, and the change of the src
of iframe
, pointing to a new blank file and not to the file that contained the code.
window.open(src, id);
– MarceloBoni