Let me prefix this by saying that I know next to nothing about Java
(so please try to keep explainations simple). I use PHP for my
server-side web programming. Here is my dilemma:
I need a JavaScript function to be called with a dynamic parameter, an
ID# known by the server. The way I would go about doing this in PHP
would be extremely simple:
<script>
foo(<?PHP echo ID; ?>);
</script>
PHP would then pre-process the PHP code and print out the content of
the variable 'ID'. When it would come time for the browser to
interpret the JavaScript it would read (for example):
<script>
foo(7);
</script>
The value '7' would then be passed into the foo() function, everything
works perfectly. The problem is that I need some way to do with with
Java. The company I work for is working with another company that uses
Java as their server-side language. I gave them this information, and
they replied saying that because they use Java, there is no way to do
this. Is that true? Is Java a preprocessor? If not, is there a work
around? Basically what it comes down to is: How can I have a
JavaScript function called with a parameter from Java?
Please help! Thanks!
(so please try to keep explainations simple). I use PHP for my
server-side web programming. Here is my dilemma:
I need a JavaScript function to be called with a dynamic parameter, an
ID# known by the server. The way I would go about doing this in PHP
would be extremely simple:
<script>
foo(<?PHP echo ID; ?>);
</script>
PHP would then pre-process the PHP code and print out the content of
the variable 'ID'. When it would come time for the browser to
interpret the JavaScript it would read (for example):
<script>
foo(7);
</script>
The value '7' would then be passed into the foo() function, everything
works perfectly. The problem is that I need some way to do with with
Java. The company I work for is working with another company that uses
Java as their server-side language. I gave them this information, and
they replied saying that because they use Java, there is no way to do
this. Is that true? Is Java a preprocessor? If not, is there a work
around? Basically what it comes down to is: How can I have a
JavaScript function called with a parameter from Java?
Please help! Thanks!
Comment