Re: Which Is The Better Approach To Working With Javascript?
- From: The Natural Philosopher <a@xxx>
- Date: Wed, 09 Jul 2008 15:07:40 +0100
Patient Guy wrote:
Jerry Stuckle <jstucklex@xxxxxxxxxxxxx> wrote in comp.lang.php:
Patient Guy wrote:Which is the better approach in working with Javascript?3. Try a javascript newsgroup. This one is for PHP.
1. Server side processing: Web server gets form input, runs it into
the Javascript module, and PHP collects the output for document prep.
2. Client side processing: Web server gets form input and passes it
to PHP which includes the Javascript written in a way to make the
form input processed on the client side and rendered (probably using
DOM function calls) on that side as well.
I posted this <news:Xns9AD554BCD7E9FUVAA@xxxxxxxxxxxx> in an
apparently less trafficked newsgroup and the post was the TLDR kind,
but it has the background and details of why the code must be in
Javascript and why PHP must work with it somehow. It also gives the
details of the server and how it forks and communicates with
processes to parse/generate output.
So, based on your response, you are telling me that a PHP processing implementation has no interprocess communication capability, or ability to interface with a (Java)script interpreter.
Java SCRIPT (as opposed to java) runs in the browser exclusively. It makes local decsison without reference to the server. This is great for speed..you can change screen appearance fast and dynamically, producing e.g. drop down menus and the like) at the expense of having to download all the code TO the browser and more data than you probably need.
PHP is EXCLUSIVELY server side, and is used to generate context sensitive pages, often coupled to a database engine. It takes as much processing and decsion making out of the brwsers hands as possible, cincentraying te cde where its more easily maintainable - on teh sever itself.
Halfway huse s do exist - Ajax - where partial page reloads are done dynamically, using I think javascipt on e browser and PHP server side.
Hint: javascript does NOT run on the server.
A server, or a server-associated process, can start a script host, passing some form of input to it, and the script host does the script interpretation, while the calling process waits for output.
However this is achieved, PHP (by design?) has no script interface, based on your response.
Oh, its perfectly possible to pass commands from PHP to some other engine: teh classic example is the Mysql server, which is interfaced to PHP with a library ..but no one would ever attempt to execuste java SCRIPT on the server, because its a bloody awful language, and is only by and large written for broswers.
Once you are server side you can in principle write in any language you like, PHP being just a common popular one, but shell script python, C, C++. PERL Java and so on are perfectly possible.
.
- Follow-Ups:
- Re: Which Is The Better Approach To Working With Javascript?
- From: Michael Fesser
- Re: Which Is The Better Approach To Working With Javascript?
- References:
- Which Is The Better Approach To Working With Javascript?
- From: Patient Guy
- Re: Which Is The Better Approach To Working With Javascript?
- From: Jerry Stuckle
- Re: Which Is The Better Approach To Working With Javascript?
- From: Patient Guy
- Which Is The Better Approach To Working With Javascript?
- Prev by Date: Re: Which Is The Better Approach To Working With Javascript?
- Next by Date: Re: Which Is The Better Approach To Working With Javascript?
- Previous by thread: Re: Which Is The Better Approach To Working With Javascript?
- Next by thread: Re: Which Is The Better Approach To Working With Javascript?
- Index(es):
Relevant Pages
|