0
I have an index.php that does a post in.php content, and takes the result and writes to the div #content inside index.php.
Post:
<script type="text/javascript">
$(this).on('load',function(){
var dadosLink = 'nada';
$.ajax({
url:'conteudo.php',
method: 'POST',
data:{ dados:dadosLink},
success: function(data)
{
$("#conteudo").html(data);
},
error: function(data)
{
$("#conteudo").html(data);
}
});
});
</script>
in the content. php, I have:
<?php require_once('Connections/Gymo.php');
$aba = $_POST['dados'];
if ($aba == "nada") {
echo "
<IFRAME name=Destaques frameBorder=0 style=\"overflow: scroll; height: 100vh; width: 100vw;\" scrolling=auto src=\"inicio.php?dados=".$aba."&mercado=".$mercado."&email=".$email."\">
<div align=\"center\"></div>
</IFRAME>
";
?>
within the start.php iframe, I have:
<div class = "conteudo" id = "conteudo"> Quero replicar esta div para index.php com o mesmo id </div>
My question: How to make the contents of this div contained in iframe passed to the div #content contained in index.php, replacing its values, whatever they are?
This action would have to happen when activating the ajax function of iframe: "$(this). on('load',Function()..."
Thank you. I edited my question to make it clearer. I tried this way above but could not, maybe with some example more step by step I can understand, I apologize for being means Newbie.
– Gymo
Just put the content of the answer inside your Success: Function(data) {}, maybe I didn’t understand the question too well.
– Diego Schmidt