ajax to html

A

Andrew Poulos

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
 
Z

Zvonko Biskup

Andrew Poulos said:
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.
 
B

Bart Van der Donck

Andrew said:
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.
 
T

Thomas 'PointedEars' Lahn

Andrew said:
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</acronym> is 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
 
T

Thomas 'PointedEars' Lahn

Bart said:
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
 
B

Bart Van der Donck

Thomas said:
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.
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

No members online now.

Forum statistics

Threads
473,769
Messages
2,569,582
Members
45,067
Latest member
HunterTere

Latest Threads

Top