sa******@gmail.com wrote:
Can anyone confirm is AJAX request can be sent over HTTPS if the
containing page is loaded via HTTPS? or is it true that all AJAX
interaction take place via HTTP? (Since the name of the class is
XMLHttpRequest and not XMLHttpsRequest)
First, there is no such thing as an "AJAX request". What is referred to
by the AJAX (commercial) buzzword now is still merely a well-known XML HTTP
request, i.e. a HTTP request initiated through a host object, implementing
an interface specified in or provided by the MSXML API, and the evaluation
of the corresponsing HTTP response through it. Hence the name of the MSXML
interface, IXMLHTTPRequest, and the host object that implements it.
Second, HTTPS is not another protocol, it is merely HTTP over an SSL/TLS-
encrypted connection. Since that encryption works transparent to the user
agent and so to the object described above, it should be entirely possible
to issue an HTTP request over that connection using that object, too, the
proper protocol part of the request URI ("https:") provided.
Since it works from location-bar script code --
javascript
:var x = new XMLHttpRequest(); x.open('GET',
'https://bugzilla.mozilla.org/duplicates.cgi?sortby=delta&reverse=1&maxrows=100& changedsince=30');
x.onreadystatechange = function() { if (x.readyState == 4 && /^2
0/.test(x.status)) alert(x.responseText); }; void(x.send(null));
-- on <URL:https://bugzilla.mozilla.org/> in Firefox 1.5.0.1/Linux, you
should just give it a try.
HTH
PointedEars