I am a newbie and working on a google-chrome extension, that needs to make jquery ajax requests to a server, load some html documents . My server is Apache, running on localhost using XAMPP 1.7.3. an the jquery is jquery-1.6.1.js.
When I load it using standard browser like chrome like http://localhost/Chrome/popup.html, the jquery ajax works. And it loads the html documents funtionaly. But, the problem is when I open my extension by "Load unpacked extension" in Google Chrome (Google Chrome 11) extension developer mode. The html document won't load.
Anyone can help solving my ploblem?
this is my code :
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);
}
});
}
}
...
please tell me if anything wrong..
send = function() { console. log( arguments ); //Here is where you can add any code to process the request. //If you want to pass the Ajax request object, pass the 'pointer' below var pointer = this var intervalId = window. setInterval(function(){ if(pointer. readyState !=
Type the url in the main input field and choose the method to use: GET/POST/PUT/DELETE/PATCH. Click on the arrow "Send" or press Ctrl+Enter.
You should specify an absolute (full) URL in the $.ajax call (i.e. http://localhost/Chrome/ssc/contentpage1.txt).
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With