473,287 Members | 1,492 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,287 software developers and data experts.

AJAX and HTTPS

Hi,

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)

Thanks,
Sameer

Feb 20 '06 #1
3 91243
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
Feb 20 '06 #2
Thomas 'PointedEars' Lahn wrote:
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));


Grmbl. Someone[tm] stole the "|" from my original test code.
Should have been:

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));

The first version would work here too, because the status code of an
expected response would be within the 20x range. However, the second
version is more generic and handles requests on non-HTTP(S) resources,
too (which is not necessary here, though). See also

<URL:http://msdn.microsoft.com/library/en-us/xmlsdk/html/f6de15fc-72e9-418e-b275-d94b0b2045de.asp>
and
<URL:http://www.w3.org/Protocols/rfc2616/rfc2616-sec10.html>
(or <URL:http://www.rfc-editor.org/rfc/rfc2616.txt>)
PointedEars
Feb 20 '06 #3
Thomas 'PointedEars' Lahn wrote:
<snip>
... . 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.

<snip>

Just to be absolutely unambiguous; XML HTTP requests work over https
exactly as they do over http. If they did not our QA department would
have said something by now as they test over https almost exclusively,
and our web applications use web services (and so XML HTTP requests) so
extensively that they would not do much if they did not work.

Richard.
Feb 20 '06 #4

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

6
by: Arnaud | last post by:
Hi, I'm trying to translate an asp application in a php way, i'm using Php 4.3.x. I'm going to try an asp newsgroup too, but as it mainly deals with Php, I would like to submit you my probem :...
1
by: empiresolutions | last post by:
I am using this really neat and easy AJAX inline text edit script, http://www.yvoschaap.com/index.php/weblog/ajax_inline_instant_update_text_20/. It works great on localhost and HTTP. But, when i run...
1
gregerly
by: gregerly | last post by:
I've got a question regarding how AJAX calls are handled over HTTPS pages. On my site, I've got a signup form that collects credit card info. It's a three part form, 1. Enter personal Info 2. Enter...
1
by: saravj2ee | last post by:
Hi, I have implemented prototype.js file to use AJAX calls in my application. I need to call cross domain to get some value from different server. The HTML and prototype file are hosted in...
4
by: anaconda1977 | last post by:
From client side, I access with https. In my code alert(location.protocol) // pop up https new Ajax.Updater("sip_tab_content", "/rails/test_modules/show/" +...
3
by: anaconda1977 | last post by:
From client side, I access with https. In my code alert(location.protocol) // pop up https new Ajax.Updater("sip_tab_content", "/rails/test_modules/show/" +...
2
by: muiz123 | last post by:
Can we use AJAX to submit a https request in a http page? E.g. 1. Open a page: http://localhost/test.html. test.html code: <html> <head> <script src="script/sys.js" language="JavaScript"...
2
by: sekku | last post by:
When we are directly access the application from Application server(localhost).I am getting the correct response. This is URL ...
2
isladogs
by: isladogs | last post by:
The next Access Europe meeting will be on Wednesday 7 Feb 2024 starting at 18:00 UK time (6PM UTC) and finishing at about 19:30 (7.30PM). In this month's session, the creator of the excellent VBE...
0
by: MeoLessi9 | last post by:
I have VirtualBox installed on Windows 11 and now I would like to install Kali on a virtual machine. However, on the official website, I see two options: "Installer images" and "Virtual machines"....
0
by: DolphinDB | last post by:
The formulas of 101 quantitative trading alphas used by WorldQuant were presented in the paper 101 Formulaic Alphas. However, some formulas are complex, leading to challenges in calculation. Take...
0
by: Aftab Ahmad | last post by:
So, I have written a code for a cmd called "Send WhatsApp Message" to open and send WhatsApp messaage. The code is given below. Dim IE As Object Set IE =...
0
by: ryjfgjl | last post by:
ExcelToDatabase: batch import excel into database automatically...
0
isladogs
by: isladogs | last post by:
The next Access Europe meeting will be on Wednesday 6 Mar 2024 starting at 18:00 UK time (6PM UTC) and finishing at about 19:15 (7.15PM). In this month's session, we are pleased to welcome back...
0
by: marcoviolo | last post by:
Dear all, I would like to implement on my worksheet an vlookup dynamic , that consider a change of pivot excel via win32com, from an external excel (without open it) and save the new file into a...
1
isladogs
by: isladogs | last post by:
The next Access Europe meeting will be on Wednesday 6 Mar 2024 starting at 18:00 UK time (6PM UTC) and finishing at about 19:15 (7.15PM). In this month's session, we are pleased to welcome back...
0
by: Vimpel783 | last post by:
Hello! Guys, I found this code on the Internet, but I need to modify it a little. It works well, the problem is this: Data is sent from only one cell, in this case B5, but it is necessary that data...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.