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

Michael Dougherty Michael_Dougherty at PBP.com
Tue Apr 8 12:32:42 CDT 2003


actually, that onClick should have been:
onClick='hiddenStuff.style.display = (hiddenStuff.style.display=="none") ?
"inline" : "none"; '

What do you mean by remote execution?  What are you using it for?
(I'm not familiar with PHP, i thought it was a server side language...)

OK, i think i have a better picture of what you mean.

If your business logic is tied up in server-side PHP/data, then why not
execute the form?  I'm not trying to dismiss the problem, just understand
why other technologies aren't used.  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; ' />

(if the innerHTML is "bad" then feel free to use a DOM-compliant equivalent
:)

  If these were manipulations of data, then i'd suggest using ADO to access
SQL Stored Procedures directly from the client - but that does require the
database server be accessible (and vulnerable) to the user's environment.
This may not be a problem if there is a single user account with minimal
required rights on a server hardened for exposure.

  I may also be missing the point entirely :)

-----Original Message-----
Michael's suggestion gets about half-way to where I need to be...  merely
manipulating the
style properties of objects inside a span is useful, but a far cry from
remote execution.

Michael Dougherty wrote:
>>
>> <span id='hiddenStuff' style='display: none;'>
>>   <!--this HTML will render inside an undisplayed container -->
>>   <input type='text' name='pseudo-hidden-field1' value='' />
>> </span>
>> <input type='button' value='Toggle'
>> onClick='(hiddenStuff.style.display=="none") ? "inline" : "none"; ' />

What would be really neat is if this could be generalized as follows:

  <span id='hiddenStuff' style='display: none'>
  <!-- this HTML will render inside an undisplayed container -->
  <?php
    function somethingReallyComplex(var1, var2, var3, ...) {
      lots of abstruse PHP code...
      return returnValue;
    }
  ?>
  </span>

  and elsewhere in the more visible code...

  <input type='button' value='launch somethingReallyComplex'
         onClick='[mysterious stuff] somethingReallyComplex(val1, val2,
val3, ...) [more mysterious stuff]'>

  If all the parameters, objects, etc. which are needed by the PHP code
are already defined and accessible, the client should (in theory) be able
to invoke the PHP code out-of-band.  There are ways of doing this
presently by launching a remote and popping
the PHP code into it, but that is sort of awkward.  (Also the window
manager gets
grumpy if you have orphan windows laying about after a premature manual
exit).  I'd like to replace the remote with the same or similar code
inside an embedded in-line structure of some sort.  Who cares if it is
actually executing on the server -- what
matters is that the PHP code is invoked by user-generated events, and
makes reference to client-side window elements and data.

  Yours in perplexity,

  Dave Lovering
_______________________________________________
Javascript mailing list
Javascript at LaTech.edu
https://lists.LaTech.edu/mailman/listinfo/javascript



More information about the Javascript mailing list