刷新页面的一部分 [英] Refreshing part of a page

查看:84
本文介绍了刷新页面的一部分的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

大家好,

如果可以刷新页面的一部分,有人可以帮助我吗

而无需重新加载整个页面。让我们说,我想在我的网页上添加一个小的

消息框。写完一条消息后,用户按下发送按钮

,我只想刷新页面的这一部分,然后给他一个状态消息,说明他的消息已成功收到。

如果是,我该怎么办?


谢谢。

解决方案

PSN写道:


大家好,

如果可以刷新一个,有人可以帮助我页面的一部分,

而不重新加载整个页面。让我们说,我想在我的网页上添加一个小的

消息框。写完一条消息后,用户按下发送按钮

,我只想刷新页面的这一部分,然后给他一个状态消息,说明他的消息已成功收到。


如果是的话,我该怎么做?


谢谢。






这可以通过JavaScript相对容易地完成。

PHP仅生成输出浏览器,因此不参与显示页面部分的


您可以使用的技术是:

1) IFrame



2)AJAX


在这里查看快速入门:
www.w3schools.com 并查看AJAX。


问候,

Erwin Moller


PS:由于这不是PHP相关问题,我建议你继续使用

comp.lang.javascript ,响应快速的优秀团体。


< comp.lang.php>

< PSN>

< 2 Nov 2006 05:56:14 -0800>

< 11 ********************** @ b28g2000cwb。 googlegroups .com>


如果可以刷新ap,有人可以帮助我页面的艺术,

而无需重新加载整个页面。让我们说,我想在我的网页上添加一个小的

消息框。写完一条消息后,用户按下发送按钮

,我只想刷新页面的这一部分,然后给他一个状态消息,说明他的消息已成功收到。


如果是,我该怎么做?



我使用了< iframe来显示如下脚本。


从它的声音中你不会将页面设置为刷新每15美元或者其他任何东西 - 所以 - 你不会得到闪烁效果。 />
-
www.phpchatroom.co.uk


Erwin Moller:


在这里查看快速入门:
www.w3schools.com 并查看AJAX。



不要以为我会推荐W3Schools,Erwin,特别是如果他们的HTML

教程是可以接受的。在Web上花费了大量的时间和精力

创作新闻组揭穿W3Schools的HTML教程传播的神话和错误印象

。例如,尽管

他们在后面的页面中说了什么,但这一介绍助长了常见的错误概念,即标签是浏览器如何显示Web的指示

页。


我当然假设其他教程是

同样质量差。对他们的PHP教程的批评将是

赞赏。


-

Jock


Hi all,
Can some one help me if it is possible to refresh a part of a page,
without reloading the whole page. Let''s say, i want to add a small
message box to my webpage. After writing a message, the user presses
the send button and i want only this part of the page to refresh and
give him a status message saying his message was successfully received.
If yes, how can i do it ??

thanks.

解决方案

PSN wrote:

Hi all,
Can some one help me if it is possible to refresh a part of a page,
without reloading the whole page. Let''s say, i want to add a small
message box to my webpage. After writing a message, the user presses
the send button and i want only this part of the page to refresh and
give him a status message saying his message was successfully received.
If yes, how can i do it ??

thanks.

Hi,

This can be done relatively easy with JavaScript.
PHP only produces output for a browser and is thus not involved in
displaying parts of a page.
The technics you could use are:
1) An IFrame
or
2) AJAX

Have a look here for a quickstart:
www.w3schools.com and look at AJAX.

Regards,
Erwin Moller

PS: Since this is not a PHP related question, I suggest you continue in
comp.lang.javascript, an excellent group with fast responses.


<comp.lang.php>
<PSN>
<2 Nov 2006 05:56:14 -0800>
<11**********************@b28g2000cwb.googlegroups .com>

Can some one help me if it is possible to refresh a part of a page,
without reloading the whole page. Let''s say, i want to add a small
message box to my webpage. After writing a message, the user presses
the send button and i want only this part of the page to refresh and
give him a status message saying his message was successfully received.
If yes, how can i do it ??

I used a <iframefor the script shown below .

From the sound of it you wont be setting the page to refresh every 15
seconds or whatever - so - you wont get the flicker effect .
--
www.phpchatroom.co.uk


Erwin Moller:

Have a look here for a quickstart:
www.w3schools.com and look at AJAX.

Don''t think I''d recommend W3Schools, Erwin, especially if their HTML
tutorial is anything to go by. Much time and effort is spent in Web
authoring newsgroups debunking the myths and false impressions
propagated by the W3Schools'' HTML tutorial. For example, in spite of
what they say in later pages, the introduction fosters the common
misconception that tags are instructions to browsers how to display Web
pages.

I am of course making the assumption that the other tutorials are
similarly poor in quality. Criticism of their PHP tutorial would be
appreciated.

--
Jock


这篇关于刷新页面的一部分的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆