En un archivo js
$(document).ready(function () {
$('#render').click(function() {
$.ajax({
url: "/renders/html",
//method: "POST",
data: {
content: $('#html').val()
},
beforeSend: function() {
$('.indicator').show();
},
success: function(data) {
console.log(data);
$('#result').html(data);
},
error: function (jqXHR, textStatus, errorThrown) {
$('#result').html(textStatus);
},
complete: function () {
$('.indicator').hide();
}
});
return false;
}) ;
});
On 05/09/18 15:45, Dennis Quesada Cruz wrote:
OJalá hubiera una lista para programadores!! pero bueno, a lo mejor
alguien tiene por ahí algún snippet de código o simple ejemplo de como
usar Ajax con jQuery y Django, (no tengo internet) asi que no me manden
links lindos como en Telegram jajaja.
Lo que quiero es que dada una X vista, esta devuelva un objeto Json que
pueda luego "halar" mediante Ajax con jQuery...
_______________________________________________
Gutl-l mailing list -- gutl-l(a)listas.jovenclub.cu
To unsubscribe send an email to gutl-l-leave(a)listas.jovenclub.cu
--
Yoander Valdés Rodríguez
GNU/Linux SysAdmin
Desarrollador PHP y Blogger
http://www.librebyte.net