0
I’m trying to pull a content through ajax but I’m not getting, nothing appears in Received Jax.
HTML:
<a href="#portfolioModal54" class="portfolio-link"
data-toggle="modal" id="executaAjax" value="Executa ajax">
<img src="<?php echo "$imageM"?>" alt="project 2">
<div class="fundo-port">
<h1><?php echo "$tipo"?></h1>
<h2><?php echo "$nome"?></h2>
</div>
</a>
<div class="wrap RecebeAjax">
</div>
ajax.js:
$(document).ready(function(){
$('#executaAjax').click(function(){
$.ajax({
url: "ajax.php",
success:(function(data){
$('.RecebeAjax').html(data);
}
});
});
ajax.php (content to be pulled)
<div id="text-proj">
<h1 style="font-size: 35px;">Mania de Lanches</h1>
<img class="linhaP" src="images/linha.png" style="padding-top: 15px;padding-left: 13px; margin-bottom: 20px;"><img class="linhaPM" src="images/linha.png">
<h1 style="margin-bottom: 20px;font-size: px;">Rede Social</h1><div id="prop3">
<h2>Mídia virtual desenvolvida para a lanchonete Mania de Lanches divulgando promoções e datas especiais para atrair o consumo e interesse de seus clientes.
</h2>
</div>
<div id="img-proj">
<img src="images/port/full/markedigi/rede/mania/post.jpg">
</div>
didn’t pull the ajax
– kaiquemix
includes the whole url: http://<your-server>/ajax.php. Something else, html(data) could not be replaced by "innerhtml = date"?
– Andre Mesquita
I did it for Felipe Assunção’s answer and it worked. Thanks for helping @Andre
– kaiquemix