Hi,
On Jul 21, 2:44 am, Nilima Chavan <[email protected]> wrote:
> Hi,
>
> I need to embed server side java script function in my HTML page.
>
> For e.g.
> <html>
> <body>
> <!-- javascript function goes over here -->
> write("javascript function call);
> </body>
> </html>
>
> Is this type of application development is possible with v8? I am
> planning to use Apache server.
It depends on what you want to do specifically. I can think of three
options:
1. Output unprocessed JavaScript into a web page,
2. Run JavaScript on the server (in a way similar to PHP), or...
3. Run JavaScript as the server.
1. If you'd simply like to output unprocessed or perhaps lightly
configured (for example, just choosing a different set of code to use
client-side) JavaScript, I'd recommend using PHP (or your favorite
server-side language: Ruby, Perl, Python, ASP, .NET, etc.) to just
select a different block of text-like scripts to output.
Example:
<?php if ($showBlockOne) { ?>
function JavaScriptForBrowser () { /* Do something. */ }
<?php
}
else {
?>
function JavaScriptForBrowser () { /* Do something else. */ }
<?php } ?>
2. If you'd like to run JavaScript on the server (using Apache as the
server, for example), then I might see the V8CGI project:
http://code.google.com/p/v8cgi/ I'd also have a look at their Apache
Configuration page: http://code.google.com/p/v8cgi/wiki/ApacheConfiguration
3. If you'd like to run JavaScript on the server computer as the Web
server itself (as in JavaScript replaces Apache), then I'd look at the
"node.js" project: http://nodejs.org/ It may require some
configuration and careful planning, but it looks like it's really fun
to work with.
I hope these suggestions are helpful,
pikpik
--
v8-users mailing list
[email protected]
http://groups.google.com/group/v8-users