title: jquery function executing without the event happening
body: <p>I have a few functions that are executed immediately </p>
  
  <pre><code>function calcTheSize() {
    console.log("exec 1")
  };
  calcTheSize();
  
  function setImages() {
    console.log("exec 2")
  };
  setImages();
  </code></pre>
  
  <p>I also want them to run on a resize event like this</p>
  
  <pre><code>$window.resize(function() {
    calcTheSize();
    setImages();
  });
  </code></pre>
  
  <p>The problem is I am getting</p>
  
  <blockquote>
    <p>exec 1
    exec 2
    exec 1
    exec 2
    exec 1
    exec 2</p>
  </blockquote>
  
  <p>without any resizing</p>