quinta-feira, 25 de outubro de 2007

Passing PHP vars by parameter to Javascript functions

Usually PHP programmers need to build dynamic systems like scrools , random text , image galleries ...
First time i tryed to build some php features using javascript i faced some problems using php and javascript, concretely passing php variables to javascript fucntions by parameter.
On this article i´ll teach how i solve this problem.
First we will declare an JavaScript function . Let´s use the simple example above.

The function must be added between the tags head on the html code

Check how to add php code as parameters on javascript functions

And it´s done

Visit my php web site at www.revista-php.net , and add your questions


2 comentários:

Câmera Digital disse...

Hello. This post is likeable, and your blog is very interesting, congratulations :-). I will add in my blogroll =). If possible gives a last there on my blog, it is about the Câmera Digital, I hope you enjoy. The address is http://camera-fotografica-digital.blogspot.com. A hug.

chrisloki disse...

Hi Guto,
I wrote a PHP library which makes the integration between PHP and javascript easier.
Check it, if you want to: http://www.chrisb.com.br/blog/js-calls-php-interacao-entre-javascript-e-php/