Re: RES: [PHP] Help Call Javascript Methods Inside PHP

2008-05-21 Thread Nitsan Bin-Nun
I was surprised it didnt came up before.
As Tedd said, try to ajax-up your javascript

On 20/05/2008, tedd [EMAIL PROTECTED] wrote:

 At 11:41 AM -0300 5/20/08, Thiago Pojda wrote:

 That way you can conditionally send some JS to client, but running actual
 JS
 in PHP is not possible.


 While running JS inside of PHP is at best confusing, it is possible to use
 both php and javascript  together. For example:

 You can use php to run javascript, right?

 And, you can use javascript and run php, right?

 So, all you need between the two is communication, right?

 Think of ajax.

 Here's an example:

 http://webbytedd.com/b/timed-php/

 It just takes a little work.

 Cheers,

 tedd
 --
 ---
 http://sperling.com  http://ancientstones.com  http://earthstones.com

 --
 PHP General Mailing List (http://www.php.net/)
 To unsubscribe, visit: http://www.php.net/unsub.php




Re: [PHP] Help Call Javascript Methods Inside PHP

2008-05-20 Thread Shelley
You missed what I meant.

Suppose there is a piece of code like:
script language-javascript
function hello() {
document.write hello;
}
/script

I want to call that method inside PHP:
?php
$c = hello();
echo $c;
?

Hope you get it.


On Tue, May 20, 2008 at 5:40 PM, Chetan Rane [EMAIL PROTECTED]
wrote:

 Yea

 You can use the script tag in PHP

 Its like
 ?php phpcode ?

 script language=javascript src=soruce of the file
 type=text\javascript/

 script language=javascript
 Funcyion()
 /script

 ?php phpcode ?

 This works

 Chetan Dattaram Rane
 Software Engineer



 -Original Message-
 From: Shelley [mailto:[EMAIL PROTECTED]
 Sent: Tuesday, May 20, 2008 3:06 PM
 To: PHP General list
 Subject: [PHP] Help Call Javascript Methods Inside PHP

 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?
 If it is, how?

 Thank you very much.

 --
 Regards,
 Shelley




-- 
Regards,
Shelley


Re: [PHP] Help Call Javascript Methods Inside PHP

2008-05-20 Thread Shelley
Yea, of course.

On Tue, May 20, 2008 at 5:44 PM, jose javier parra sanchez 
[EMAIL PROTECTED] wrote:

 Do you know that php runs on the server and that javascript runs on the
 client ?

 2008/5/20 Shelley [EMAIL PROTECTED]:
  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?
  If it is, how?
 
  Thank you very much.
 
  --
  Regards,
  Shelley
 




-- 
Regards,
Shelley


Re: [PHP] Help Call Javascript Methods Inside PHP

2008-05-20 Thread Richard Heyes

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



[PHP] Help Call Javascript Methods Inside PHP

2008-05-20 Thread Shelley
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?
If it is, how?

Thank you very much.

-- 
Regards,
Shelley


Re: [PHP] Help Call Javascript Methods Inside PHP

2008-05-20 Thread Shiplu
On 5/20/08, Shelley [EMAIL PROTECTED] 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?
 If it is, how?

 Thank you very much.

 --
 Regards,

 Shelley


Hello,
Its possible. I think you have to find seamonkey binding for php or you have
to create it.
There is javascript engine from mozilla. you can use that too.

--
A. K. M. Mokaddim
http://talk.cmyweb.net


RES: [PHP] Help Call Javascript Methods Inside PHP

2008-05-20 Thread Thiago Pojda
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
[EMAIL PROTECTED]
Excelência em Softwares Financeiros

-Mensagem original-
De: Richard Heyes [mailto:[EMAIL PROTECTED] 
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





--
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php



RES: [PHP] Help Call Javascript Methods Inside PHP

2008-05-20 Thread Thiago Pojda
Yeah, I just checked out and that runat=Server thingy is an asp thing.


Atenciosamente,
www.softpartech.com.br
Thiago Henrique Pojda
Desenvolvimento Web
+55 41 3033-7676
[EMAIL PROTECTED]
Excelência em Softwares Financeiros


-Mensagem original-
De: Thiago Pojda [mailto:[EMAIL PROTECTED] 
Enviada em: terça-feira, 20 de maio de 2008 11:41
Para: [EMAIL PROTECTED]; 'Shelley'
Cc: 'PHP General list'
Assunto: RES: [PHP] Help Call Javascript Methods Inside PHP

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
[EMAIL PROTECTED]
Excelência em Softwares Financeiros

-Mensagem original-
De: Richard Heyes [mailto:[EMAIL PROTECTED] 
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





-- 
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php





--
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php



Re: RES: [PHP] Help Call Javascript Methods Inside PHP

2008-05-20 Thread tedd

At 11:41 AM -0300 5/20/08, Thiago Pojda wrote:

That way you can conditionally send some JS to client, but running actual JS
in PHP is not possible.


While running JS inside of PHP is at best confusing, it is possible 
to use both php and javascript  together. For example:


You can use php to run javascript, right?

And, you can use javascript and run php, right?

So, all you need between the two is communication, right?

Think of ajax.

Here's an example:

http://webbytedd.com/b/timed-php/

It just takes a little work.

Cheers,

tedd
--
---
http://sperling.com  http://ancientstones.com  http://earthstones.com

--
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php