2012-02-25 86 views
0

我與Chrome瀏覽器擴展玩弄所以我做了這個popup.htmljQuery.load()是無法在Chrome擴展工作

<script src="http://code.jquery.com/jquery-latest.js"></script> 
<script> 
    var request; 

    // Get the current tab information 
    chrome.tabs.getSelected(null, function(tab) { 
     request = tab.url; 
    }); 


    $("#page").load(request, function(response, status, xhr) { 
     if (status == "error") { 
      $("#page").html("Sorry but there was an error: " + xhr.status + " " + xhr.statusText); 
     } 
    }); 
</script> 

<span id="page"></span> 

的問題是,當我按一下按鈕它只是顯示一個小小的空白方形彈出的工具欄。我試圖檢查Popup,但在調試控制檯上沒有錯誤。我該怎麼做才能糾正這個問題?

回答

2

你需要給它的權限訪問* .jquery.com

+0

沒有改變**(** – 2012-02-25 04:55:29

+0

給它的權限來star.star – 2012-02-26 02:41:59

+0

你確定你再次加載呢? – 2012-02-26 02:42:25