title: Ajax with chrome extension
body: <p>I send the url to a php file in chrome extension, and need get response, but doesn't work.</p>
  
  <p>manifest.json</p>
  
  <pre><code>{
    "name": "Get pages source",
    "version": "1.0",
    "manifest_version": 2,
    "description": "Get pages source from a popup",
    "browser_action": {
      "default_icon": "icon.png",
      "default_popup": "popup.html"
    },
    "permissions": ["http://localhost/"]
  }
  </code></pre>
  
  <p>popup.js</p>
  
  <pre><code>chrome.tabs.query({'active': true, 'lastFocusedWindow': true}, function (tabs) {
      var url = tabs[0].url;
  var parametros = {
              "url" : url
      };
  $.ajax({
      type: "POST",
      data: parametros,
      url: 'file.php',
      success: function(data) {
          var res = jQuery.parseJSON(data);
          alert("success");
      },
      error: function(e) {
          alert("error");
      }
  });
  
  });
  </code></pre>
  
  <p>file.php - Is in the same folder, in localhost</p>
  
  <pre><code>&lt;?php 
  $resultado = $_POST['url']; 
  echo $resultado;
  ?&gt;
  </code></pre>
  
  <p>and the popup.html</p>
  
  <pre><code>&lt;html style=''&gt;
  &lt;head&gt;
      &lt;script src="https://code.jquery.com/jquery-2.2.0.min.js"&gt;&lt;/script&gt;
  &lt;script src='popup.js'&gt;&lt;/script&gt;
  &lt;/head&gt;
  &lt;body style="width:400px;"&gt;
  &lt;span id="resultado"&gt;0&lt;/span&gt;
  &lt;/body&gt;
  &lt;/html&gt;
  </code></pre>
  
  <p>This code only return a empty array.</p>
  
  <p>Not is posible use Ajax in chrome extension?</p>
  
  <p><strong>EDIT:</strong></p>
  
  <p>I charge jquery with a local file, not CDN, and work fine.</p>
  
  <p>Other issue is in my code, I thing that is in jQuery.parseJSON.</p>
  
  <p>Thanks to all ;)</p>