I'm learning to use AJAX
, and I want to insert an image after click a button.
But the image doesn't appear, instead appears lots of characters.
How can I do it correct?
$(document).ready(function() {
$('#botonAjax').click(function() {
type: "GET",
$.ajax({
url: "Img/inlaw.png",
success: function(result) {
$('#divAjax1').append(result);
}
});
});
});
<script src="https://ajax.googleapis.com/ajax/libs/jquery/2.1.1/jquery.min.js"></script>
<div id="divAjax1">
<h2>TEST AJAX</h2>
</div>
<button id="botonAjax">Cargar contenido externo</button>
Thank you very much ´