473,795 Members | 2,498 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

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 91344
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.mozill a.org/duplicates.cgi? sortby=delta&re verse=1&maxrows =100&changedsin ce=30');
x.onreadystatec hange = function() { if (x.readyState == 4 && /^2
0/.test(x.status) ) alert(x.respons eText); }; void(x.send(nul l));

-- on <URL:https://bugzilla.mozill a.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.mozill a.org/duplicates.cgi? sortby=delta&re verse=1&maxrows =100&changedsin ce=30'); x.onreadystatec hange = function() { if (x.readyState == 4 && /^2
0/.test(x.status) ) alert(x.respons eText); }; void(x.send(nul l));


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

javascript:var x = new XMLHttpRequest( ); x.open('GET',
'https://bugzilla.mozill a.org/duplicates.cgi? sortby=delta&re verse=1&maxrows =100&changedsin ce=30');
x.onreadystatec hange = function() { if (x.readyState == 4 &&
/^2|0/.test(x.status) ) alert(x.respons eText); }; void(x.send(nul l));

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.as p>
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
3268
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 : I have to retrieve some XML datas from a server whose URL is built like that : https://myserver:4012/code/myapp?param1=3;
1
3040
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 it on the destination HTTPS server it fails to send the edited field name and values described in the "Update File". My javascript is a little lacking so your help is much appreciated. Simply put.. How do i get this script to run over HTTPS? ...
1
5354
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 credit card info 3. Confirmation. I'm handling the different steps with AJAX. So, you land on an https page that has you enter your personal info and click continue. An ajax request is performed and the data is saved to the server, and the credit...
1
4430
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 https://wwww.myserver.xyz.com.I need to call other sever which URL ends with same as my server “xyz.com “(https://wwww.otherserver.xyz.com) The below mentioned code is working fine only in IE browser, But it is not working in Firefox and Safari...
4
1807
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/" + $F("boardid"), {method :'get', onFailure:displaySIPTabFailure, onComplete:displaySIPTabFailure });
3
3424
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/" + $F("boardid"), {method :'get', onFailure:displaySIPTabFailure, onComplete:displaySIPTabFailure });
2
3497
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" type="text/javascript"></script> <script src="script/prototype.js" language="JavaScript" type="text/javascript"></script> </head>
2
2944
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 http://localhost:27110/vcm-ui/request?vui.request.transport=json&vui.response.transport=json&vui.request=%20HTTP/1.1 Response /*{xapi:{metadata:{"user": "?","status": "ok","request": "http://localhost:27110/vcm-ui/request"},container:{"type": "vui","id": "0.8391487769614959",data:}}}*/ When we are trying to...
0
9672
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However, people are often confused as to whether an ONU can Work As a Router. In this blog post, we’ll explore What is ONU, What Is Router, ONU & Router’s main usage, and What is the difference between ONU and Router. Let’s take a closer look ! Part I. Meaning of...
0
9519
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can effortlessly switch the default language on Windows 10 without reinstalling. I'll walk you through it. First, let's disable language synchronization. With a Microsoft account, language settings sync across devices. To prevent any complications,...
0
10213
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven tapestry of website design and digital marketing. It's not merely about having a website; it's about crafting an immersive digital experience that captivates audiences and drives business growth. The Art of Business Website Design Your website is...
1
10163
by: Hystou | last post by:
Overview: Windows 11 and 10 have less user interface control over operating system update behaviour than previous versions of Windows. In Windows 11 and 10, there is no way to turn off the Windows Update option using the Control Panel or Settings app; it automatically checks for updates and installs any it finds, whether you like it or not. For most users, this new feature is actually very convenient. If you want to control the update process,...
0
9040
agi2029
by: agi2029 | last post by:
Let's talk about the concept of autonomous AI software engineers and no-code agents. These AIs are designed to manage the entire lifecycle of a software development project—planning, coding, testing, and deployment—without human intervention. Imagine an AI that can take a project description, break it down, write the code, debug it, and then launch it, all on its own.... Now, this would greatly impact the work of software developers. The idea...
1
7538
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 1 May 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM). In this session, we are pleased to welcome a new presenter, Adolph Dupré who will be discussing some powerful techniques for using class modules. He will explain when you may want to use classes instead of User Defined Types (UDT). For example, to manage the data in unbound forms. Adolph will...
0
5563
by: adsilva | last post by:
A Windows Forms form does not have the event Unload, like VB6. What one acts like?
1
4113
by: 6302768590 | last post by:
Hai team i want code for transfer the data from one system to another through IP address by using C# our system has to for every 5mins then we have to update the data what the data is updated we have to send another system
3
2920
bsmnconsultancy
by: bsmnconsultancy | last post by:
In today's digital era, a well-designed website is crucial for businesses looking to succeed. Whether you're a small business owner or a large corporation in Toronto, having a strong online presence can significantly impact your brand's success. BSMN Consultancy, a leader in Website Development in Toronto offers valuable insights into creating effective websites that not only look great but also perform exceptionally well. In this comprehensive...

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.