[Javascript] Passive, Javascript-callable, in-line (PHP)codereferences wit

David T. Lovering dlovering at gazos.com
Tue Apr 8 14:38:40 CDT 2003


Hmmm... I think we're getting closer.  The problem I have is that although
JavaScript is invaluable at handling all the addressable DOM elements in
a window-based application, its support of database lookups, external i/o,
files, etc. is a bit weak (particularly when they reside on the server).
The PHP (or whatever) handles database lookups, file processing, and system
interface stuff like a dream, but is only marginally powerful at tweaking
the various minutae of the window constructs.  By combining them together
(with appropriate sensitivity to security issues), you get the best of
both worlds.  Treating PHP, ASP, or whatever purely as a forms processing
language in the fashion of a CGI/BIN is missing about 80% of the true kick
that these respective languages can offer.

The problem with 'executing the form' is that with any terribly complicated
application a great deal of number crunching and lots of incremental back-and-forthing
with the user may be required.  Of course, one can always build 27 different
windows, and 27 different form-handlers to deal with them all, but that seems
a bit extreme.  The dynamic code aspect lets a lot of the backend work be
carried on without any visible interruption of the user's session, or tedious
redraws/refreshes of the screen.  Since most of this involves database lookups
and the like (which aren't particularly graphic in nature), all goes smoothly.

The src redirection of an iframe within a span looks like it has real possibilities.
Any real security nazi would probably insist on a "POST" session interface rather
than a clear-text GET, but the idea is definitely there. I'll poke around with it
and see if I can develop a paradigm that will work with my applications.  If it
boils out, I'll post a couple of code snippets to show what I come up with.

Thanks!

BTW -- if we're being canonical, shouldn't the <input> declarations of var1,
var2, etc. be inside the span? Not that I'm complaining, mind you...

-- Dave Lovering

Michael Dougherty wrote:
> If the idea is to put the result of a
> function into the document, then have you tried the iframe sourced on a
> remote procedure handler?
> 
> <span ... >
>   <iframe id='callToServer' src='' ><iframe>
> </span>
> <input type='text' name='var1' value='a' />
> <input type='text' name='var2' value='b' />
> 
> <span id='result'></span>
> 
> <input type='button' value='SS-Compute'
>         onClick='callToServer.src= "/somethingReallyComplex.xyz?var1=" + var1.value
> + "&var2=" + var2.value;
> result.innerHTML = callToServer.innerHTML; ' />


More information about the Javascript mailing list