I'm doing a system, more precisely, an HTML HTML and CSS editor, in which I need to send two fields via POST
to a php page, which will process the data and save it to a random-named html file, generated at each page refresh.
So far so good, I'm sending this data via AJAX
to prevent the page from refreshing and the file name changes.
On the same page there is a iframe
referring to the html page created, except that when sending the data via AJAX
and saving to the html file, I should give reload
in iframe
to update the file to which it references, like this:
document.getElementById("myIframe").contentWindow.location.reload();
The problem is there, at the time of giving reload
in iframe
, the whole page is updated (I say this because the loading icon appears as in the image below.)
What brings about the generation of a new filename, which, as I said, with each page refresh a new name is generated, and the src
change of the iframe
, pointing to a new file in white and not to the file that contained the code.