jQuery crea un nuevo div con ID?
Tengo formulario en mi ASP.NET masterPage.master y si hago clic en enviarlo, llame a algún método desde el archivo masterPage.master.cs por ajax (lo tengo en el panel de actualización). Pero quiero mejorarlo con jQuery. Entonces tengo esto:
$('#submit').click(function () {
$.ajax({
type: "POST",
url: '<% Response.Write("~"+Request.Path); %>',
beforeSend: function () {
$(document.createElement('div')).width($('#formBox').width())
.height($('#formBox').height())
.css({ backgroundImage: 'url(/Static/Img/bc_overlay.png)', position: 'absolute', left: 0, top: 0, margin: "5px", textAlign: "center", color: "#000", display: "none" })
.append("<strong>Načítám</strong><br /><img src='Static/Img/ajax-loader.gif' width='33px' height='33px' alt='loading' />")
.fadeIn("slow")
.prependTo($('#formBox'));
$('#formBox').css('position', 'relative');
},
success: function () {
}
});
});
Así que si hago clic en enviar, se está creando un nuevo div (se está cargando texto e imagen, y una superposición de opacidad genial), pero ¿Cómo le doy a este div alguna identificación? Porque necesito usarlo en
success: function () {
}
Necesito borrar este cuadro y escribir aquí un texto (error o éxito).