FAQ Topic - What is Ajax? (2009-09-12)

FAQ Topic - What is Ajax? (2009-09-12)

Post by FAQ serve » Sun, 13 Sep 2009 08:00:02


-----------------------------------------------------------------------
FAQ Topic - What is Ajax?
-----------------------------------------------------------------------

Ajax
is shorthand for Asynchronous JavaScript and XML. The technology is
based on the ` XMLHttpRequest ` Object. At its simplest,
it is the sending/retrieving of new data from the server without
changing or reloading the window location.

Mozilla Documentation:

http://www.yqcomputer.com/

MSDN Documention:

http://www.yqcomputer.com/

http://www.yqcomputer.com/

Ajax
Libraries and Tutorial Sites:

http://www.yqcomputer.com/

http://www.yqcomputer.com/

An alternative to the ` XMLHttpRequest ` Object is Remote Scripting:

http://www.yqcomputer.com/


The complete comp.lang.javascript FAQ is at
http://www.yqcomputer.com/

--

The sendings of these daily posts are proficiently hosted
by http://www.yqcomputer.com/ .
 
 
 

FAQ Topic - What is Ajax? (2009-09-12)

Post by kanga » Sun, 13 Sep 2009 11:45:02


[...]


None of these are unit tested? I see some functional tests in the one by
Matt Kruse, but neither even mention which browsers they were tested on.

[...]

--
kangax

 
 
 

FAQ Topic - What is Ajax? (2009-09-12)

Post by Jorg » Sun, 13 Sep 2009 19:41:34


Question 1: How many web services' public apis are based on
XMLHttpRequests ?
answer: None, not even a single one.

Question 2: Why ?
answer: because XMLHttpRequests are restricted by the Same Origin
Policy, they can't fetch data from other domains.

Question 3: So, how do I do "AJAX" when the data is in a different
domain ?
answer: everybody is using "the script tag hack", nobody is using
XMLHttpRequests.

Question 4: XML ? What's that ? Do I need to learn yet another thing
in order to do AJAX ?
answer: No. Not at all. You'd better read and learn about JSON, the
light-weight data-interchange format whose specification fits in the
backside of a bussiness card, unlike that of XML.

Useful reading :

http://www.yqcomputer.com/ +script+tag+hack+explained
http://www.yqcomputer.com/ +bussiness+card
http://www.yqcomputer.com/ +cross+domain
http://www.yqcomputer.com/

:-)

Jorge.
 
 
 

FAQ Topic - What is Ajax? (2009-09-12)

Post by Garrett Sm » Mon, 14 Sep 2009 02:31:10


Apparently not.

I see some functional tests in the one by

Simple, running examples are useful for learning how something works.

The FAQ does not cover testing at all. I think it probably should.

---------------------------------------------------
Q: How can I unit test my code?
A: [answer]

See also:
[recommended test framework]
[general unit testing info]
---------------------------------------------------

I am using a modified version of YUI Test Beta for my own testing. I've
not upgraded to the latest version.

The useful part of YUI Test is async testing.

I've noted and reported problems with Event generation in Saf 2, FF 2,
and Opera 9.2.x.
--
Garrett
comp.lang.javascript FAQ: http://www.yqcomputer.com/
 
 
 

FAQ Topic - What is Ajax? (2009-09-12)

Post by Garrett Sm » Mon, 14 Sep 2009 02:54:53


That is not frequently asked and not a very practical question. Should
be along the lines of: "How do I [xxx]?"


Fair question. (nit: Ajax, not AJAX).

JSONP? Adding a script tag allows a script from another domain to run.

A server proxy can be used and the data is available as text.

Firefox 3.5 has "HTTP access control", but I can't see how to detect its
support[1] and IE8 has XDomainRequest, which is feature-detectible.

I don't think either are worth mentioning either until they are more
widely implemented.

https://developer.mozilla.org/En/HTTP_access_control
--
Garrett
comp.lang.javascript FAQ: http://www.yqcomputer.com/
 
 
 

FAQ Topic - What is Ajax? (2009-09-12)

Post by kanga » Mon, 14 Sep 2009 12:29:54


While I agree that unit testing is a rather important topic (which
unfortunately doesn't seem to be getting enough attention in Javascript
land), we can't put things that aren't often asked in a FAQ, can we?

I haven't seen much of unit testing questions here (for the past year),
so I'm not sure if it's a good FAQ candidate.

[...]

--
kangax