Re: run-time environment of a text/javascript request?



On Feb 15, 1:15 am, Kenneth Tilton <kentil...@xxxxxxxxx> wrote:
Kenneth Tilton wrote:
I am trying to drive my client app from the server side by sending over
JS in response to requests with mime "text/javascript".

Sending over "alert('hi mom')" works great.

Sending over "alert('answer='+answer42)" where answer42 is a global var
(bound to 42) does nothing, not even alert me with answer=undefined, not
even cause an error in chrome or ff debuggers.

Hard to believe, but I have been back and forth a few times checking my
sanity.

Is what I am attempting doable? ie, Ship code over that knows about code
in the client environment?

I guess my next try will be eval, but what I am thinking is that that is
prolly the same thing and what I am seeing is that (like Lisp) eval
happens in a separate null environment. Just guessing tho. Even in a
null environment I would expect answer=undefined.

Aha! Using eval produces an undefined error (but I was calling a
function defined in normal client-side JS, not referencing a global var).

Examples and doc I am finding on eval are not encouraging, either.

Give it up?


Please.

.



Relevant Pages

  • Re: Qualifying method calls
    ... There's no `alert` either. ... additional module is loaded into that kind of environment, ... How would you alias `window` to <Global ... host-features (host objects, mapping host objects to some built-in ...
    (comp.lang.javascript)
  • RE: NetProwler!!!!! (CryWolf the return)
    ... a few deficiencies when deployed in a live production environment of any ... counter-intuitive (such as it's alert priority graphing) and quite ... button signature update via the web from the vendor's web site. ... While it does have the ability to adjust the subnets that each sensor ...
    (Focus-IDS)
  • Re: O.T.- Chrome plating on salt water boat items??
    ... >weather and environment of a boat that is used in salt water. ... >are not talking about a propeller here, but various chrome trinkets ... Hot-dipped zink plating works fine, although it's not as fancy looking ...
    (alt.machines.cnc)
  • Re: run-time environment of a text/javascript request?
    ... Ship code over that knows about code ... in the client environment? ... happens in a separate null environment. ... Using eval produces an undefined error (but I was calling a ...
    (comp.lang.javascript)
  • Re: run-time environment of a text/javascript request?
    ... Ship code over that knows about code ... in the client environment? ... happens in a separate null environment. ... Using eval produces an undefined error (but I was calling a ...
    (comp.lang.javascript)