RES: [PHP] Help Call Javascript Methods Inside PHP
| From: | Thiago Pojda | Date: | Tue, 20 May 2008 14:41:00 +0000 |
| Subject: | RES: [PHP] Help Call Javascript Methods Inside PHP | ||
| References: | 1 2 | Groups: | php.general |
| Request: | Send a blank email to php-general+get-274562@lists.php.net to get a copy of this message | ||
What Richard meant was:
/// FILE.PHP ///
<?php
$var = 123;
if ($var > 100){
?>
<script language="JavaScript"> alert('Bigger than 100'); </script>
<?php
}
?>
/// EOF ///
That way you can conditionally send some JS to client, but running actual JS
in PHP is not possible.
(Not sure about Jscript [script runat=server] tho, I believe it only runs on
IIS)
Atenciosamente,
www.softpartech.com.br
Thiago Henrique Pojda
Desenvolvimento Web
+55 41 3033-7676
thiago.pojda@softpartech.com.br
Excelência em Softwares Financeiros
-----Mensagem original-----
De: Richard Heyes [mailto:richardh@phpguru.org]
Enviada em: terça-feira, 20 de maio de 2008 06:53
Para: Shelley
Cc: PHP General list
Assunto: Re: [PHP] Help Call Javascript Methods Inside PHP
Shelley wrote:
> Hi all,
>
> How can I call a javascript method inside PHP?
> That is:
> Suppose there is a js file: http://someurl/somejs.js
> There are some js methods in that js file,
> I want to include that js into PHP and call its methods.
>
> Is it possible?
No.
What you can do though is use PHP to send some HTML to the browser which
calls Javascript methods.
--
Richard Heyes
In Cambridge? Employ me
http://www.phpguru.org/cv
+----------------------------------------+
| Access SSH with a Windows mapped drive |
| http://www.phpguru.org/sftpdrive |
+----------------------------------------+
--
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php