title: Display a waiting gif during a javascript function
body: <p>I write a script to get a text file, to modify this texter file and then I import the file in our software.<br>
  The problem is that the import of the file is very slow (just this part of the script could take more than 1 minute sometime).
  I would like to display a waiting gif during this process, so the user can see that the process is running, and he need to wait.</p>
  
  <p>Some precision:<br>
   - It's only a javascript file with no html page<br>
   - The script is launched with a button in our software and I have access to ActiveXObject if necessary</p>
  
  <p>Here is a sample code :  </p>
  
  <pre><code>function importFec()
  {
      var iOpenDlg = 1;
      var sPath = "Deskop";
      var sTypes = "Fichier Texte (*.txt)|*.txt";
      var sExt = "txt";
      //Allow me to select a file in Windows
      cheminFEC = fileDialog(iOpenDlg, sPath, sTypes, sExt);
  
      var fso = new ActiveXObject("Scripting.FileSystemObject");
      var ForReading = 1;
      var f1 = fso.OpenTextFile(cheminFEC, ForReading);
      var texte = f1.ReadAll();
  
      var tableauFEC = [];
      var tableauTest = [];
      tableauFEC = texte.split(/\r\n/);
      tableauTest = tableauFEC[0].split("\t");
      var delimiter = "\t";
      if (tableauTest.length == 1)
      {
          tableauTest = tableauFEC[0].split("|");
          var delimiter = "|";
      }
      var nbColonne = tableauTest.length;
      for (var i=0;i&lt;tableauFEC.length;i++)
      {
          var tab = tableauFEC[i].split(delimiter);
          tableauFEC[i] = new Array(25);
          for (var j=0;j&lt;nbColonne;j++)
          {
               tableauFEC[i][j] = tab[j];
           }
      }
  
      //Make some change in the table to adapt my texte file
      //Then create a new texte file C:\\FichierFEC\\FECModifie.txt
      createNewFEC(tableauFEC);
  
      var cwfConfiguration = Application.ApplicationInfo("ProgramPath")+"\\Library\\ImportFEC\\ImportFEC23032017.vgl"
      var oImport = Import(ipASCII)
      oImport.ImportComponents = CWImportComponents.icGeneralLedger
      oImport.ASCIILayoutFile = cwfConfiguration
      oImport.ASCIIDataFile = "C:\\FichierFEC\\FECModifie.txt"
      //This is the function which take a long moment to execute
      oImport.RunImport()
  
  }
  </code></pre>
  
  <p>Thanks for your answer and explanation</p>