title: How secure is my javascript, how easily can it be exploited?
body: <p>I'm trying to make this code as secure as possible are there any imediate flaws that jump out? I <em>think</em> I have it locked down pretty tightly, is there anything else you would implement?</p>
  
  <pre><code>  function CheckPin(){
  
      var str="0123456789abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ";
  
      var strId= document.form1.tbPin.value;
  
      var lenId=strId.length;
  
      var check=true;
  
  
  
      //if (lenId != 20)
  
      if (!(lenId ==20 || lenId == 10))
  
      {
  
          alert("You must enter a 20 or 10 digit pin number.");
  
          document.form1.tbPin.focus();
  
          return false;
  
      }
  
      else
  
      {
  
          //for(var i=0;i&lt;20;i++)
  
          for(var i=0;i&lt;lenId;i++)
  
           { 
  
              check=str.indexOf(strId.charAt(i));
  
  
  
              if(check == -1) 
  
              {
  
                  alert("Do not use special characters.(e.g. @,#,&amp;) ");
  
                  document.form1.tbPin.focus();
  
                  return false;
  
                  break;
  
              }
  
              else 
  
              {
  
                   if (i ==19)
  
                   {
  
                      break;
  
                   }
  
              }
  
           }
  
      }
  
  
  
      if (document.form1.btnChecker.value == 1)
  
      {
  
       alert("The processing is in progress.");
  
       return false;
  
      }
  
  
  
      document.form1.btnChecker.value = 1;
  
      }
  
      &lt;/script&gt;
  
      &lt;script src="../JS/Tags.js" type="text/javascript"&gt;&lt;/script&gt;
  
      &lt;script src="../JS/Tags2.js" type="text/javascript"&gt;&lt;/script&gt;
  </code></pre>
  
  <p>Tags.js:</p>
  
  <pre><code>var gaJsHost = (("https:" == document.location.protocol) ? "https://ssl." : "http://www.");
  document.write(unescape("%3Cscript src='" + gaJsHost + "google-analytics.com/ga.js' type='text/javascript'%3E%3C/script%3E"));
  </code></pre>
  
  <p>Tags2.js:</p>
  
  <pre><code>var pageTracker = _gat._getTracker("UA-1376772-6"); pageTracker._initData(); pageTracker._trackPageview();
  </code></pre>