title: Javascript jQuery external file
body: <p>I'm running an index.html file after outsourcing the control.js file it doesnt work together:</p>
  
  <pre><code>&lt;!DOCTYPE html&gt;
  &lt;html&gt;
   &lt;head&gt;
    &lt;script src="http://ajax.googleapis.com/ajax/libs/jquery/1.10.2/jquery.min.js"&gt;&lt;/script&gt;
    &lt;script src="control.js"&gt;&lt;/script&gt;
   &lt;/head&gt;
   &lt;body&gt;
    &lt;p id="space"&gt;&lt;/p&gt;
    &lt;button id="temp1"&gt;Sensor1&lt;/button&gt;
    &lt;p id="space2"&gt;&lt;/p&gt;
    &lt;button id="temp2"&gt;Sensor2&lt;/button&gt;
   &lt;body&gt;
  &lt;/html&gt;
  </code></pre>
  
  <p>my control.js file:</p>
  
  <pre><code>$(document).ready(function(){
      $("button#temp1").click(function(){
          $.get("/temp", function(data){
              document.getElementById('space').innerHTML = data;
          });
      });
      $("button#temp2").click(function(){
          $.get("/temp2", function(data){
              document.getElementById('space2').innerHTML = data;
          });
      });
  });
  </code></pre>
  
  <p>doesn't work together, so what do I wrong? Thanks</p>