|
Posted by Morlaath on 08/27/07 02:02
On Aug 26, 9:00 pm, Morla...@gmail.com wrote:
> Is there a way to embed php within javascript code? I know that php is
> server side and js is client side. For instance when working with jsp,
> you can imbed jsp scriptlets within the js code.
>
> e.g
>
> <script language="javascript">
> function foo() {
> var bar = <%=(java variable)%>
>
> <% if (bar == null) { %>
> alert("Null value");
> <% } %>}
>
> </script>
Lol ... the example above isn't quite right. Replace var bar = <
%=(java variable)%> with <%= String bar = "test"; %>, then it would
work.
Navigation:
[Reply to this message]
|