Troubles using Jquery to render partial html with javascript functions inside
Hi all, first of all sorry for my English.
I have problems when render html with JQuery, and inside that html i want to use some javascript functions defined in the .js linked in the page.
My code to render the html is like:
var form = $("form[name='formAdvancedSearch']");
$.ajax({
type: "POST",
url: form.attr('action'),
data: form.serialize(),
error: function(xhr, status, error) {
display_error("Error de conexión con el servidor...");
},
success: function(response) {
//do something with response
$('#content_drch').html(response);
}
});
I have this in the .js linked in the page
$(".icono_resultado").click(function() {
// do some stuffs
alert('hi');
return false;
});
and this in the html response <div class="icono_resultado">Hi</div>
The first time i load the whole page the javscript function is working, but when i use the ajax call doesn't work
I'm using MVC 2 .net. Any help is wellcome, thanks a lot