I am working with ASP.NET MVC, JQuery I want to call a document.ready from an ajax that is in a partial view, I show code:
PARTIAL VIEW
<script type="text/javascript" language="javascript">
$('form').submit(function (e) {
e.preventDefault();
//$('#message').empty();
var $form = $(this);
if ($form.valid()) {
$.ajax({
url: this.action,
type: this.method,
data: $(this).serialize(),
cache: false,
success: function (result) {
if (result.guardado) {
//Codigo para reinicializar el datatable
}
},
error: function (result) {
}
});
}
});
</script>
INDEX
$(document).ready(function () {
$('#proveedores').DataTable({
"processing": true,
"serverSide": true,
"ajax": {
"url": "Cliente/Index",
"dataType": "jsonp"
}
});
});
I want to call that document.ready from the if it is in the other partial view. How could I do it?