[Javascript] Passive, Javascript-callable, in-line (PHP) code references withina

Michael Dougherty Michael_Dougherty at PBP.com
Tue Apr 8 11:20:44 CDT 2003


<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"; ' />

  One nice side effect of putting visible inputs into a hidden container is
that you can easily toggle the span's display for debugging (then take the
toggle function away in the production version)


-----Original Message-----
From: javascript at LaTech.edu [mailto:javascript at LaTech.edu]
Sent: Tuesday, April 08, 2003 12:13 PM
To: javascript at latech.edu
Subject: [Javascript] Passive, Javascript-callable, in-line (PHP) code
references withina



While continuing to research the multiframe/multiform issues with respect
to the 'onLoad' event, I came across another conundrum.

How does one reference in-line code modules within a given HTML document,
particularly if they are to be invoked by a Javascript call?  The reverse
is simple (simply embed a <script> ... </script> block), so I had hopes
that this would be also.  Yes, yes
-- I know:  I'm mixing client-side code with server-side code.  Dont' bug
me -- it works (and works well), despite what the books would have you
believe.  As long as you keep tabs on the sequence of invocation and who
has the execution and/or access to
which variables, it isn't that tough.  However, I want to condense my
rather large collection of executable php files into some kind of inline
structure I can mesh passively with the regular HTML document, and still
invoke the needed routines from
JavaScript whenever I like.

I've experimented with DIVs, IFRAMEs, anchors, and such like -- but all of
these tend to have a screen presence, and distort the existing screen
geometry.  The only way I've found (so far) that works is to deliberately
build another window, hide it, pour
the PHP code (or whatever) into it, and then back-reference to the objects
in the window.opener document.  This is ugly, and it tends to turn one's
statusbar into a riot of activity.

Any clues?  I'm certain there is some bizarre combination of anchors,
divs, <script> and such-like that will permit this to happen, but I've
found no references to anyone else doing it.  It is one piece of magic I'd
really like to have in my warchest.

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




More information about the Javascript mailing list