title: phonegap barcode scanner plugin -> Reference Error
body: <p>Can somebody help me with this: When I try to run the project, this is my code in the index.html`s head:</p>
  
  <pre><code>    &lt;script type="text/javascript" src="barcodescanner.js"&gt;&lt;/script&gt;
  &lt;script type="text/javascript" src="main.js"&gt;&lt;/script&gt;
  
  &lt;script type="text/javascript" charset="utf-8" src="phonegap.js"&gt;&lt;/script&gt;
  &lt;script type="text/javascript"&gt;
      function onLoad() {
      document.addEventListener("deviceready", onDeviceReady, false);
  }
  
  
  // PhoneGap is loaded and it is now safe to make calls PhoneGap methods
  //
  function onDeviceReady() {
      window.plugins.barcodeScanner.scan( function(result) {
      alert("We got a barcode\n" +
                "Result: " + result.text + "\n" +
                "Format: " + result.format + "\n" +
                "Cancelled: " + result.cancelled);
  }, function(error) {
      alert("Scanning failed: " + error);
  }
  );
  }
  &lt;/script&gt;
  </code></pre>
  
  <p>I get the following error:</p>
  
  <pre><code>11-05 12:22:23.641: E/Web Console(454): ReferenceError: Can't find variable: PhoneGap at file:///android_asset/www/barcodescanner.js:57
  </code></pre>
  
  <p>the file is from the bar code scanner plugin. Its in the correct folder (project/assets/www). Somebody would help with this, would be great.
  thanks</p>
  
  <p>edit:</p>
  
  <p>The line wich causes the problem in the barcodescanner.js says the following:</p>
  
  <pre><code>PhoneGap.addConstructor(function() {
  PhoneGap.addPlugin('barcodeScanner', new BarcodeScanner());
  </code></pre>
  
  <p>});</p>