从php调用javascript警报

编程入门 行业动态 更新时间:2024-10-12 01:23:53
本文介绍了从php调用javascript警报的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧! 问题描述

嗨我希望能够在php中触发javascript风格的弹出式提醒 (我想在实际页面上显示一条消息)这可能吗?

解决方案

monomaniac21写道:

嗨我希望能够在php中触发javascript风格的弹出警报 (我想要的实际网页上显示的消息)这可能吗? I''ll借此一个...我通常在这里做的就是提问。 你的问题的答案是否定的。在..... / * 之前,PHP运行在*服务器上页面显示。因此,Php无法弹出像JavaScript这样的警报 (在页面加载后在*客户端计算机上运行)。 那说;如果您想实施两步程序,例如 (1)删除此文件。 (2)您确定(是或否)? 您可以使用Php执行此操作,但是单击(1)必须创建一个请求,以便服务器显示一个新页面(2)作为形式或超链接。 点击Y或N必须再次返回服务器才能执行 操作。 - ***************************** Chuck Anderson?博尔德,CO www.CycleTourist 每个人的旅程应该是不同的, 这样我们所有人都会以新的和无尽的方式丰富 ** *******************************

Chuck Anderson写道:

monomaniac21写道:

>嗨我希望能够在php中触发javascript风格的弹出警报(我希望在实际页面上显示一条消息)这可能吗?

我会拿这个...我通常都是这里是问问题。 您的问题的答案是否。在显示 页面之前,Php在*服务器上运行。因此,Php无法弹出像JavaScript这样的警报 (在页面加载后在*客户端计算机上运行)。 那说;如果您想实施两步程序,例如 (1)删除此文件。 (2)您确定(是或否)? 您可以使用Php执行此操作,但是单击(1)必须创建一个请求,以便服务器显示一个新页面(2)作为表单或超链接。 点击Y或N必须再次返回服务器才能执行 操作。

,也可以有PHP吐出JavaScript作为网页和 触发它的onclick的一部分=在提交。 -david-

David Haynes写道:

Chuck Anderson写道:

> monomaniac21写道:

>>嗨我希望能够触发javascript风格的弹出警报在php (我希望在实际页面上显示一条消息)这可能吗? 我会选择这个...我通常在这里做的就是提问。 你的问题的答案是否定的.Php在*服务器之前运行*显示页面。因此,Php无法弹出类似JavaScript的警报(在页面加载后在*客户端计算机上运行)。 如果你想实施一个两步程序,如 (1)删除这个文件。(2)你确定(是或否)? 你可以用Php做到这一点,但是点击(1)必须创建一个请求,要求服务器显示带有(2)作为表单或超链接的新页面。点击Y或N必须返回到再次能够/>动作进行 ,也可以有PHP吐出JavaScript作为网页的一部分, 从提交中的onclick =触发它。 -david-

但是那个'不是'在Php中触发并且只是JavaScript。 - *********************** ****** Chuck Anderson? Boulder,CO www.CycleTourist 每个人的旅程应该是不同的, 这样我们所有人都会以新的和无尽的方式丰富 ** ***************************

hi i want to be able to trigger a javascript style popup alert in php (i want a message displayed on the actual page) is this possible?

解决方案

monomaniac21 wrote:

hi i want to be able to trigger a javascript style popup alert in php (i want a message displayed on the actual page) is this possible?

I''ll take this one ... all I usually do here is ask questions. The answer to your question is No. Php is run on the *server before* the page is displayed. Therefore, Php cannot popup an alert like JavaScript (which runs on the *client computer after* the page is loaded). That said; if you want to implement a two step procedure like (1) Delete this file. (2) Are you Sure (Y or N)? You can do that with Php, but clicking on (1) must create a request to the server to display a new page with (2) as a form or hyperlinks. Clicking on Y or N must return to the server again in able to perform the action. -- ***************************** Chuck Anderson ? Boulder, CO www.CycleTourist Everyone''s journey should be different, so that we all are enriched in new and endless ways *****************************

Chuck Anderson wrote:

monomaniac21 wrote:

>hi i want to be able to trigger a javascript style popup alert in php(i want a message displayed on the actual page) is this possible?

I''ll take this one ... all I usually do here is ask questions. The answer to your question is No. Php is run on the *server before* the page is displayed. Therefore, Php cannot popup an alert like JavaScript (which runs on the *client computer after* the page is loaded). That said; if you want to implement a two step procedure like (1) Delete this file. (2) Are you Sure (Y or N)? You can do that with Php, but clicking on (1) must create a request to the server to display a new page with (2) as a form or hyperlinks. Clicking on Y or N must return to the server again in able to perform the action.

or you can have the php spit out the javascript as part of the page and trigger it from the onclick= in the submit. -david-

David Haynes wrote:

Chuck Anderson wrote:

>monomaniac21 wrote:

>>hi i want to be able to trigger a javascript style popup alert in php(i want a message displayed on the actual page) is this possible?

I''ll take this one ... all I usually do here is ask questions.The answer to your question is No. Php is run on the *server before* thepage is displayed. Therefore, Php cannot popup an alert like JavaScript(which runs on the *client computer after* the page is loaded).That said; if you want to implement a two step procedure like(1) Delete this file.(2) Are you Sure (Y or N)?You can do that with Php, but clicking on (1) must create a request tothe server to display a new page with (2) as a form or hyperlinks.Clicking on Y or N must return to the server again in able to performthe action.

or you can have the php spit out the javascript as part of the page and trigger it from the onclick= in the submit. -david-

But that''s not "triggered in Php" and is simply JavaScript. -- ***************************** Chuck Anderson ? Boulder, CO www.CycleTourist Everyone''s journey should be different, so that we all are enriched in new and endless ways *****************************

更多推荐

从php调用javascript警报

本文发布于:2023-11-27 17:50:31,感谢您对本站的认可!
本文链接:https://www.elefans.com/category/jswz/34/1639004.html
版权声明:本站内容均来自互联网,仅供演示用,请勿用于商业和其他非法用途。如果侵犯了您的权益请与我们联系,我们将在24小时内删除。
本文标签:警报   php   javascript

发布评论

评论列表 (有 0 条评论)
草根站长

>www.elefans.com

编程频道|电子爱好者 - 技术资讯及电子产品介绍!