我可以在Google扩展程序上放置popup.php而不是popup.html吗?

时间:2011-02-20 18:21:42

标签: php google-chrome

谢谢!我刚下载了一个hello world示例文件,并意识到它只是一个HTML和JS脚本。

我可以用popup.php替换popup.html并包含PHP代码吗?

谢谢!

2 个答案:

答案 0 :(得分:2)

  1. 不,你不能。 为什么? 因为PHP需要运行webserver或(php框架)。因此.php文件不会由chrome运行。

答案 1 :(得分:-1)

您可以使用iframe和远程popup.php进行制作;]

这是我的popup.php:

<html>
<head>
<title>Example Project</title>
</head>
<body>
<center><h1>Project: Example</h1>
<h3>Under Construction</h3>
<img src="<?= 'http://myvegaslimo.com/images/simpsons-under-construction.jpg' ?>" alt="under construction"></img></center>
</body>
</html>

这是popup.html:

<iframe src="http://example.com/chrome-extension/Example/popup.php" width="640" height="580" style="border:none;"></iframe>