By using this site, you agree to our updated Privacy Policy and our Terms of Use. Manage your Cookies Settings.
459,461 Members | 1,001 Online
Bytes IT Community
+ Ask a Question
Need help? Post your question and get tips & solutions from a community of 459,461 IT Pros & Developers. It's quick & easy.

ajax to html

P: n/a
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?

Andrew Poulos
Nov 11 '08 #1
Share this Question
Share on Google+
5 Replies


P: n/a

"Andrew Poulos" <ap*****@hotmail.comwrote in message
news:49**********************@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.

--
http://easy-translate.com
Nov 11 '08 #2

P: n/a
Andrew Poulos wrote:
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.

--
Bart
Nov 11 '08 #3

P: n/a
Andrew Poulos wrote:
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="HyperText 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, <f8*******************@news.demon.co.uk>
Nov 11 '08 #4

P: n/a
Bart Van der Donck wrote:
Andrew Poulos wrote:
>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>
Nov 11 '08 #5

P: n/a
Thomas 'PointedEars' Lahn wrote:
Bart Van der Donck wrote:
>Andrew Poulos wrote:
>>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.

--
Bart
Nov 11 '08 #6

This discussion thread is closed

Replies have been disabled for this discussion.