1
I have an Ajax function that returns me the html of a service that I have exposed, I would like to take this html and put inside the DIV of a site of my.
My function is already picking up html, but it displays html inside the DIV would like it to display content already format, without html tags
by jQuery:
$("#suaDiv").html("<html> seu html </html>")
– Marllon Nasser
Perfect! It worked, buddy! Now I need to take the fields of my form and pass the url to the service, I tried like this: $.get('.endereco.com.br/Simulacao2',$('form_t'). serialize(),Function(responseText) { But it doesn’t take my form. You know pq?
– William
See that it fits you:
$("#suaDiv").html = $.parseHTML("<html> seu html </html>")
or$("#suaDiv").html($.parseHTML("<html> seu html </html>"))
– Andre Mesquita
@William edits your question with the code you try to do the
.get
– Marllon Nasser
I tried this: "$. get('endereco.com.br/Simulacao2',$('form_t'). serialize(),Function(responseText) { " The name of my form is fom_t
– William
you’re sending it like it’s
post
, try like this:$.get('endereco.com.br/Simulacao2' + $('form_t').serialize(),function(responseText) { }
– Marllon Nasser
@ Marllon Nasser It didn’t work, my form looks like this: <form id="form_t" name="form_t" class="col S12" method="post"> It doesn’t pass the fields to the url, funny that in the old version of my form worked.
– William