title: Uncaught TypeError: object is not a function
body: <p>I'm new to javascript and I have searched for this issue across the web. It might be a simple fix, but I just can't get rid of this error (only in chrome, not FF).</p>
  
  <p>This is the javascript I have:</p>
  
  <pre><code>&lt;script&gt;
      function clikked(){
          window.alert("sometext");
      }
  &lt;/script&gt;
  </code></pre>
  
  <p>In my html I have many DIVs like this:</p>
  
  <pre><code>....
  &lt;div class="tiles2" id="1180" name="1180" onclick="clikked()"&gt;&lt;/div&gt;
  &lt;div class="tiles2" id="1181" name="1180" onclick="clikked()"&gt;&lt;/div&gt;
  ....
  </code></pre>
  
  <p>What am I doing wrong here? I always get that error in chrome... remember, I'm new to javascript, so every info will be helpful!</p>
  
  <p>edit: Here's the php part</p>
  
  <pre><code>for ($i = 0; $i&lt;2000; $i++) {
      echo '&lt;div class="tiles2" id="'.$i.'" name="'.$i.'" onClick="clikked()" &gt;&lt;/div&gt;';
  }   
  </code></pre>
  
  <p>edit 2: Here's the full Test.php code:</p>
  
  <pre><code>&lt;!DOCTYPE html PUBLIC "-//IETF//DTD HTML 2.0//EN"&gt;
  &lt;HTML&gt;
     &lt;HEAD&gt;
        &lt;TITLE&gt;
           Test
        &lt;/TITLE&gt;
     &lt;/HEAD&gt;
  &lt;BODY&gt;
  &lt;style type="text/css"&gt;
  .tiles2 {
      width: 16px;
      height: 12px;
      float: left;
      background-color: white;
      opacity: 0.9;
  }
  
  .tiles2:hover {
      opacity: 0.2;
  }
  }
  &lt;/style&gt;
  
  
  &lt;?php
  echo '&lt;div style="width: 800px; height: 480px; background-image: url(australia/austr.png); margin: 0px auto"&gt;';
  
  for ($i = 0; $i&lt;20; $i++) {
      echo '&lt;div class="tiles2" id="'.$i.'" name="'.$i.'" onClick="clikked()" &gt;&lt;/div&gt;';
  }
  echo '&lt;/div&gt;';
  ?&gt;
  
  &lt;script&gt;
      function clikked(){
          alert("sometext");
      }
  &lt;/script&gt;
  &lt;/BODY&gt;
  &lt;/HTML&gt;
  </code></pre>
  
  <p>edit 3: ok, i've "solved" it. I was running this on localhost with xampp. it works when i upload it to the server. does anyone know why?</p>