Thursday, May 23, 2024
 Popular · Latest · Hot · Upcoming
4
rated 0 times [  8] [ 4]  / answers: 1 / hits: 85782  / 14 Years ago, mon, november 22, 2010, 12:00:00

Possible Duplicate:

How to call a JavaScript function from PHP?






Can I add a javascript alert inside a PHP function? If yes, how?


More From » php

 Answers
110

Assuming that what you mean is that you want an alert to pop up from the browser when the server reaches a certain point in your php code, the answer is no.



While the server is running your php code, there's no contact with the browser (until the response starts coming back). There are situations in which a server may be streaming content back to the browser, and in such a case it'd be possible to have some agreed-upon convention for the server to mark the content stream with messages to be alerted out immediately, but I don't think that's what you're asking about here.


[#94881] Friday, November 19, 2010, 14 Years  [reply] [flag answer]
Only authorized users can answer the question. Please sign in first, or register a free account.
brandt

Total Points: 43
Total Questions: 90
Total Answers: 111

Location: Aruba
Member since Fri, Jun 24, 2022
2 Years ago
;