Home » questions » I want to pass the php variable to a javascript function?Can you help me? Thanks?

I want to pass the php variable to a javascript function?Can you help me? Thanks?

2006-08-16 13:37:41, Category: Programming & Design
I have a PHP variable : $myVariable="Hello"; And a JavaScript Function: myFunction(s){ alert (s); } But i can run it when i put it on body tag: )> Can you help me?Thanks

Answers

  1. Adam@ImagineTechsolutions.Com

    On 2006-08-16 13:45:20


    )>
  2. John J

    On 2006-08-16 13:44:14


    it looks like you have it right. you just need to inclose the PHP variable that is echoed in quotes like: