2011-05-15 29 views
7

Soy un novato y trabajo en una extensión de google-chrome, que necesita hacer solicitudes jquery ajax a un servidor, cargar algunos documentos html. Mi servidor es Apache, ejecutándose en el servidor local usando XAMPP 1.7.3. y el jquery es jquery-1.6.1.js.Extensión de Chrome Solicitud de Ajax

Cuando lo cargo usando un navegador estándar como chrome como http://localhost/Chrome/popup.html, funciona el jquery ajax. Y carga los documentos html de manera funcional. Pero, el problema es cuando abro mi extensión mediante "Cargar extensión no empaquetada" en el modo de desarrollador de extensión Google Chrome (Google Chrome 11). El documento html no cargará.

¿Alguien puede ayudar a resolver mi ploblem?

este es mi código:

manifest.json

 { 
     "name": "Nyu Extension", 
     "version": "1.0", 
     "description": "My First Extension", 
     "permissions" : ["http://localhost/", "http://*/*"], 
     "browser_action": { 
     "default_icon": "N.png", 
     "popup": "popup.html" 
     } 
     } 

popup.html

 ... 
     function activeTab(tab) 
     { 
      document.getElementById("tab1").className = ""; 
      document.getElementById("tab"+tab).className = "active";   
      if(tab == 1) 
      { 
       $.ajax({ 
        url: "ssc/contentpage1.txt", 
        success: function(data) { 
         $('#content').html(data); 
        } 
       }); 
      } 
     } 
     ... 

por favor dígame si algo malo ..

Respuesta

Cuestiones relacionadas