$.ajaxSetup({
    'beforeSend' : function(xhr) {
        xhr.overrideMimeType('text/html; charset=UTF-8');
		
    },
});

function ajaxForm(url,form,type,div){

		$.ajax( { 
				contentType: "application/x-www-form-urlencoded",
				cacheControl: "no-cache, no-store, must-revalidate",
				type: type,
				url: url,
				async: true,
				data: $(form).serialize(),

					beforeSend: function () {
							$(div).html("<div class=\"d-flex justify-content-center pt-4 pb-4\"><div class=\"spinner-border text-primary\" role=\"status\"><span class=\"visually-hidden\"></span></div></div>");
					},
					
					success: function (resultado) {
						$(div).html(resultado);
						
					}
				}
			)
	};