$(document).ready(function () { // loader $("#routeForm").submit(function (evt) { ; return ActiveRouteWaiting('RouteSubmit', 'RouteWaiting', 1); }); $("#linkAddVia").click(function (evt) { ; removeClassOnElement(document.getElementById("introVia"), 'flagVia'); addClassOnElement(document.getElementById("introVia"), 'invisible'); removeClassOnElement(document.getElementById("stepVia"), 'invisible'); }); }); // Route waiting function ActiveRouteWaiting(submitElementId, waitingElementId, nbButton) { for (i = 0; i < nbButton; i++) { var divSubmit = document.getElementById(submitElementId + i); var divWaiting = document.getElementById(waitingElementId + i); divSubmit.style.display = "none"; divWaiting.style.display = "block"; } return true; } function addWaitingElement() { // Création de la DIV div = document.createElement("div"); // Création de l'image du bouton img = document.createElement("img"); img.setAttribute("src","/img/DEFAULT/Picto/ajax-loader25x25.gif"); img.setAttribute("alt","Recherche en cours."); img.setAttribute("width","32"); div.appendChild(img); // Création du texte txt = document.createElement("span"); txt.innerHTML = 'Recherche en cours'; div.appendChild(txt); document.write(div.innerHTML); }