0
With ID I can guess, doing so:
$.ajax({
url: "www.teste.com/recuperar-senha #senha",
beforeSend: function(){
$('.main').html("<p>Carregando...</p>");
},
success: function(r){
$('.main').html(r);
}
});
But if my file doesn’t have an ID, how do I only load a div by taking the class?
Your top solution should work... is giving some error?
– Rafael Augusto
It works, but my question is this: "But if in my file there is no ID, how do I load only a div taking the class?"
– Lucas de Carvalho
Now I think I understand
– Rafael Augusto
I may be wrong, but what you want to do, if I’m not mistaken, is done with
web crawler
– Rafael Augusto
tries $('. main')[0]. html("<p>Loading...</p>");
– alexandre9865
jquery selector qdo has a class, normally it will return an array, pq can have several class with that name
– alexandre9865
if not, try to use foreach and inside put this expression q vc wants from Success
– alexandre9865