title: How does phoneGap (Cordova) work internally, iOS specific
body: <p>I have started developing html applications for mutliple platforms. I recently heard about Cordova 2.0(PhoneGap) and ever since I have been curious to know how the bridge works.
  After lot of code walking, i saw that the Exec.js is the code where call from JS -> Native happens</p>
  
  <pre><code>execXhr = execXhr || new XMLHttpRequest();
          // Changeing this to a GET will make the XHR reach the URIProtocol on 4.2.
          // For some reason it still doesn't work though...
          execXhr.open('HEAD', "file:///!gap_exec", true);
          execXhr.setRequestHeader('vc', cordova.iOSVCAddr);
          if (shouldBundleCommandJson()) {
              execXhr.setRequestHeader('cmds', nativecomm());
          }
          execXhr.send(null);
      } else {
          execIframe = execIframe || createExecIframe();
          execIframe.src = "gap://ready";
  </code></pre>
  
  <p>But want to understand how that works, what is the concept here, what does file:///!gap_exec or gap://ready do? and how does the call propgate to the lower layers (native code layers)</p>
  
  <p>thanks a bunch in advance.</p>