|
Posted by emilia.woo@gmail.com on 10/19/06 09:41
Oh, I find out!.
it's just
<input type="button" onclick="practice( '<? echo $ex; ?>' ); ">
right?
emilia.woo@gmail.com wrote:
> Hello guys.
> I have a question about js function and php variables.
>
> I want to use php variables in javascript function. For example,
>
>
> <?php
> $ex=(int)$_POST['Example'];
> ?>
>
> $ex value is 3
>
> There's js function named "practice"
> I want to run
>
> <input type="button" onclick="practice(3); ">
>
> in this case, 3 is $ex. However, I cannot use like this:
>
> <input type="button" onclick="practice( <? $ex ?> ); ">
>
> How can I use php variables in javascript function? Thank you.
Navigation:
[Reply to this message]
|