开发者

Google Extension and PHP

开发者 https://www.devze.com 2023-02-07 23:34 出处:网络
Is it possible to include a PHP file inside a G开发者_开发问答oogle Extension? If so, how do I do it?

Is it possible to include a PHP file inside a G开发者_开发问答oogle Extension? If so, how do I do it?

Here's my manifest:

{
  "name": "My very first extension",
  "version": "0.1",
  "description": "My first extension",
  "content_scripts": [
    {
      "matches": ["http://jquery.com/*"],
      "js": ["jquery.js", "content.js"]
    }
  ],
  "browser_action": {
    "default_icon": "logo.png",
    "popup" : "index.html"
  },
  "permissions": [
    "http://api.flickr.com/"
  ]
}

So I have jQuery included and it seems to be working, so in my index.html I have this javascript:

var html = $.ajax({
  url: "ajax.php",
  async: false
 }).responseText;

Is there a way to include ajax.php and query it?

This is my first one, forgive me if this is a simple problem, but Google doesn't seem to produce any topics on this one,

Thanks!


You can put php file into extension folder and read it from javascript as a text file (from a background page), you can't run that php code though.

0

精彩评论

暂无评论...
验证码 换一张
取 消