my javacript code is next I want to protect it in a file funcion.js but I do not know how it would be
var html_msg = '<div class="alert alert-success content"> <img src="img/smile.gif" border="0" align="absmiddle"> Su Conexion a sido Reiniciada con exito </div>';
$(document).ready(function () {
$('#reiniciar1').click(function (e) {
e.preventDefault();
if (window.confirm('¿Estas seguro?')) {
var segundos = 15; //aki pones los segundos que quieres que se demore.
$.ajax({
type: 'GET',
url: '/test/release.php',
success: function (data) {
console.log('ok');
$("#container-msg-success").html(html_msg);
setTimeout(function () {
$(".content").fadeOut(1500);
}, 3000);
$('#reiniciar1').attr('disabled','disabled');
setTimeout(function () {
$('#reiniciar1').removeAttr('disabled');
}, segundos * 1000);
},
});
}
});
});
this is the code