Re: run-time environment of a text/javascript request?
- From: David Mark <dmark.cinsoft@xxxxxxxxx>
- Date: Sun, 15 Feb 2009 02:16:50 -0800 (PST)
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.
.
- Follow-Ups:
- Re: run-time environment of a text/javascript request?
- From: Kenneth Tilton
- Re: run-time environment of a text/javascript request?
- References:
- run-time environment of a text/javascript request?
- From: Kenneth Tilton
- Re: run-time environment of a text/javascript request?
- From: Kenneth Tilton
- run-time environment of a text/javascript request?
- Prev by Date: Re: jQuery's latest stab at competence
- Next by Date: Re: alert is undefined
- Previous by thread: Re: run-time environment of a text/javascript request?
- Next by thread: Re: run-time environment of a text/javascript request?
- Index(es):
Relevant Pages
|