title: Except link with Javascript
body: <p>can you help me?</p>
  
  <p>I'm trying to get this code below to make a excesão links in case the variable would be</p>
  
  <pre><code>var except_link = "blogspot.com, wordpress.com";
  </code></pre>
  
  <p>But it is only making excesão of 'blogspot.com'</p>
  
  <p>thank you</p>
  
  <p><div class="snippet" data-lang="js" data-hide="false">
  <div class="snippet-code">
  <pre class="snippet-code-js lang-js prettyprint-override"><code>var except_link = "blogspot.com, wordpress.com";
  
  var allow_file = ".3gp,.7z,.aac,.ac3,.asf,.asx,.avi,.bzip,.divx,.doc,.exe,.flv,.jpg,.png,.gz,.gzip,.iso,.jar,.jav,.mid,.mkv,.mov,.mp3,.mp4,.mpeg,.mpg,.msi,.nrg,.ogg,.pdf,.ppt,.psd,.rar,.rm,.rmvb,.rtf,.swf,.tar,.tar.gz,.tgz,.torrent,.ttf,.txt,.wav,.wma,.wmv,.xls,.zip,180upload,1fichier,1filesharing,2shared,4files,4share,4shared,a2zupload,adf,adrive,adv,amazo,";
  
  except_link = (link_except != null) ? link_except : except_link;
  
  function check(siteurl) {
    if ("" + allow_file != "undefined" &amp;&amp; allow_file != "" &amp;&amp; allow_file.replace(/\s/g, "") != "" &amp;&amp; siteurl != "") {
      if ((" " + allow_file).indexOf(",") &gt; 0) {
        pular = allow_file.split(",")
      } else {
        pular = new Array(allow_file)
      }
      for (s = 0; s &lt; pular.length; s++) {
        if ((" " + siteurl.toLowerCase()).indexOf(pular[s].toLowerCase()) &gt; 0) {
          if ("" + except_link != "undefined" &amp;&amp; except_link != "" &amp;&amp; except_link.replace(/\s/g, "") != "" &amp;&amp; siteurl != "") {
            if ((" " + except_link).indexOf(",") &gt; 0) {
              pular = except_link.split(",")
            } else {
              pular = new Array(except_link)
            }
            for (s = 0; s &lt; pular.length; s++) {
              if ((" " + siteurl.toLowerCase()).indexOf(pular[s].toLowerCase()) &gt; 0) {
                return false;
                break
              }
            }
            return true
          } else {
            return true
          }
        }
      }
      return false
    } else {
      return false
    }
  }</code></pre>
  </div>
  </div>
  </p>