vuz3
vuz3

Reputation: 229

chrome.extension and $.post()

I have problem with chrome.extension and jQuery Post. I want post some data (get title and url current page and send it to my DB) from script.js to name.php when I click icon.

And in this moment I have a large problem, taburl and tabtitle don't send to name.php but I don't know why, so if someone can help me I'll realy happy.

BTW: sorry for any mistake language, script.js work on other file, but not as chrome.extension but simple code js/php. If I change $.post to $.ajax problem not disappeared.

Upvotes: 2

Views: 233

Answers (1)

Konrad Dzwinel
Konrad Dzwinel

Reputation: 37903

script.js is a content script. These scripts can't use chorme.* APIs (source). Your code is never executed as it contains errors (unknown variable "chrome.browserAction"). Try using script.js as a background page script.

Upvotes: 1

Related Questions