title: Namespace issue when calling function in one .js file from another .js file
body: <p>In an attempt to make a swipe-able slideshow for many images, I am attempting to stitch together two plugins, <a href="http://swipejs.com/" rel="nofollow noreferrer">Swipe.js</a> and <a href="http://www.appelsiini.net/projects/lazyload" rel="nofollow noreferrer">lazyloader.js</a>. I want to have the slideshow timer event from the Swipe plugin call the update function inside of Lazyloader. <a href="https://stackoverflow.com/questions/5137371/problem-calling-namespaced-function-from-javascript-function-in-another-js-file">From researching, it seems my problem appears to be one of namespace</a>; that is, Swipe doesn't know about the stuff inside Lazyloader, and therefore cannot call the function. </p>
  
  <ol>
  <li>Given the following code, am I understanding my problem correctly?</li>
  <li>If so, how can I get Swipe to access Lazyloader's functions?</li>
  </ol>
  
  <p>Thank you.</p>
  
  <p>FOLLOW UP:
  After Q&amp;A with Cheeso, I see now that I was asking the wrong question in regard to what I ultimately needed to happen. I add this comment to avoid having any future readers getting confused because of my bad question. This is not about namespace or even about accessing a private function, <a href="https://stackoverflow.com/questions/6229501/overriding-a-function-defined-in-jquery-closure">which shouldn't be done</a>. This thread is utimately about how inadvisable it may be to try and frankenstein libraries together if you don't really  know what you're doing.  ; )
  END FOLLOW UP</p>
  
  <p>The callback in swipe.js:</p>
  
  <pre><code>this.callback = this.options.callback || function() {
  </code></pre>
  
  <p>the script called inside the html:</p>
  
  <pre><code>&lt;script src="js/jquery.js" type="text/javascript"&gt;&lt;/script&gt;
  &lt;script src="js/jquery.lazyload.js" type="text/javascript"&gt;&lt;/script&gt;
  &lt;script src='js/swipe.js' type="text/javascript"&gt;&lt;/script&gt;
  
  &lt;script type="text/javascript"&gt;$(document).ready(function() {
  
  
      function myAlert(){
          //call a function from inside jquery.lazyload.js
          alertMe();
      }
  
      //instantiate a swipe object and pass in a bunch of 
      //options, especially "callback" which fires on every slide change
      window.mySwipe = new Swipe(document.getElementById('slider1'), {
          startSlide: 0,
          speed: 1000,
          auto: 5000,
          callback: function(){
              myAlert();
          }
      });
      // run lazyload on every VISIBLE image with the class "lazy" on load, and on every click
      $("img.lazy").lazyload({event: "click", effect : "fadeIn", threshold: 0,});
      }); 
  &lt;/script&gt;
  </code></pre>
  
  <p>jquery.lazyloader.js:</p>
  
  <pre><code> //outside of the container below, I can be called by myAlert()
   function alertMe() {
          alert("it worked!");
      }
  
  
  (function($, window) {
  
      $window = $(window);
  
      $.fn.lazyload = function(options) {
  
      ///
      ///Here be a bunch of lazyloader stuff
      ///
  
      //I work when above, but once I am inside this container, I cannot be called by myAlert(), 
      //and I will error as 'not a valid function'
      function alertMe() {
          alert("it worked! Even inside of this container! ");
      }
  
  
  })(jQuery, window);
  </code></pre>