"Andrew Poulos" <ap_prog@hotmai l.comwrote in message
news:49191dc7$0 $7555$5a62ac22@ per-qv1-newsreader-01.iinet.net.au ...
Is it possible to send an XHR to a HTML page to be "processed" by
javascript in that page and to then get a response back?
I think that the name ...Request Object makes it obvious that it makes a
reuest to a server-side script. I don't think that what you are asking is
possible.
Is it possible to send an XHR to a HTML page to be "processed" by
javascript in that page and to then get a response back?
Not with client-side javascript. XHR always returns the full response.
But tnder controlled conditions you could 'eval' the javascript code
inside the caller file.
Is it possible to send an XHR to a HTML page to be "processed" by
javascript in that page and to then get a response back?
No. There are no "HTML pages" to begin with; there are HTML *documents*
that are not programs (<prayer_wheel> <acronym title="HyperTex t Markup
Language">HTML</acronymis not a programming language. There are no HTML
commands. </>; [psf 7.9]), but they may *contain* (ECMAScript-compatible)
programs (through the [X]HTML `script' element) that are run *when parsed*.
PointedEars
--
Prototype.js was written by people who don't know javascript for people
who don't know javascript. People who don't know javascript are not
the best source of advice on designing systems that use javascript.
-- Richard Cornford, cljs, <f806at$ail$1$8 300dec7@news.de mon.co.uk>
>Is it possible to send an XHR to a HTML page to be "processed" by
>javascript in that page and to then get a response back?
>
Not with client-side javascript. XHR always returns the full response.
But tnder controlled conditions you could 'eval' the javascript code
inside the caller file.
I would presume "that page" means the HTML document requested, not the HTML
document from where the request originates. And the code in "that page" is
_not_ executed on such a request in its original context, and also not with
"external" eval().
PointedEars
--
Use any version of Microsoft Frontpage to create your site.
(This won't prevent people from viewing your source, but no one
will want to steal it.)
-- from <http://www.vortex-webdesign.com/help/hidesource.htm>
>>Is it possible to send an XHR to a HTML page to be "processed" by
>>javascript in that page and to then get a response back?
>
>Not with client-side javascript. XHR always returns the full response.
>But tnder controlled conditions you could 'eval' the javascript code
>inside the caller file.
>
I would presume "that page" means the HTML document requested, not the HTML
document from where the request originates. And the code in "that page" is
_not_ executed on such a request in its original context, and also not with
"external" eval().
True. But the original poster might (or might not) be interested to
'eval' the returned code, or a part of it. That is the only client-
side possibility here.
Use any version of Microsoft Frontpage to create your site.
(This won't prevent people from viewing your source, but no one
will want to steal it.)
-- from <http://www.vortex-webdesign.com/help/hidesource.htm>
Microsoft Frontpage doesn't exist anymore since 2006. Its successor
Microsoft Expression Web attempted to overcome the weaknesses of
Frontpage, and is (IMHO) reasonably succesful in that.
Comment