查看: 966|回复: 3
|
innerHTML and PHP
[复制链接]
|
|
想问下有关于innerHTML,可以在innerHTML里display php 的 result page。。。?
example,
我想display abc.php content 在,index.php的innerHTML。。。 可能吗??? |
|
|
|
|
|
|
|
发表于 8-11-2007 06:30 PM
|
显示全部楼层
可以啊。
有三个方法
1。两次http request 来拿两个 php generate出来的content
第一次,。index。php 可能是你在url bar上打
第二个, abc.php 可能你用xmlhttprequest 来拿,拿到后在丢进innerhtml
2。你也可以用 iframe 嘛。也一样是两次 http request。
第一次,。index。php 可能是你在url bar上打
第二个, innerframe 的src=abc.php 又会在做另一个 http request
3。一次http request.
index.php 还在 php interpretor process 中时, 开file 读取abc.php ,render 它的html 在把两个content 一起输出,在一次的http response 里 |
|
|
|
|
|
|
|

楼主 |
发表于 9-11-2007 09:43 AM
|
显示全部楼层
谢谢你的回复,以上的3个方法,第一个有点像AJAX的syntax。 只是第三个的方法听起来有点难,可以解释下“index.php 还在 php interpretor process 中时”?
感之不尽。。。。 |
|
|
|
|
|
|
|
发表于 17-11-2007 07:25 PM
|
显示全部楼层
回复 #3 凡人,烦人? 的帖子
$url = 'http://localhost/abc.php';
$abc_file = file_get_contents($url);
echo $abc_file; |
|
|
|
|
|
|
| |
本周最热论坛帖子
|