473,386 Members | 1,602 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,386 software developers and data experts.

Use Ajax to submit a HTTPS request

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:
Expand|Select|Wrap|Line Numbers
  1. <html>
  2.     <head>
  3.         <script src="script/sys.js" language="JavaScript" type="text/javascript"></script>
  4.         <script src="script/prototype.js" language="JavaScript" type="text/javascript"></script>
  5.     </head>
  6.     <body>
  7.         <script type="text/javascript">
  8.             function test() {
  9.                 //var url = "http://localhost/ajax?xxxx";
  10.                 var url = "https://localhost/ajax?xxxx";
  11.                 new Ajax.Request(url, {method: "get",
  12.                     onComplete: function(transport) {
  13.                         alert(transport.status + ": " + transport.responseText);
  14.                      }
  15.                  });    
  16.             }
  17.             test();
  18.         </script>
  19.         <form action="https://localhost/ajax?xxxx" name="xx">
  20.             <input type="submit" value="submit">
  21.         </form>
  22.     </body>
  23. </html>
  24.  
  25.  
2. Then run test script to submit a https request
the response status is 0. and the response test = ""

How can we add the SSL exception from a ajax response?
Sep 13 '10 #1
2 3469
Canabeez
126 100+
You can surely do that with JSON, I believe that changing the protocol would be handled as a cross-domain request which is not allowed in AJAX.
Sep 13 '10 #2
Thanks Canabeez. I will study JSON and try it.

I download JSONRequest.js, but for JSON.js, I cannot find it. Any ideas?

BTY, i want to use SSL to validate username and password.
Sep 13 '10 #3

Sign in to post your reply or Sign up for a free account.

Similar topics

2
by: Angie | last post by:
Hello everybody, I have an osCommerce shopping cart on my site, which is an open-source product that uses php. I'm very new to php. I also have an online scheduling application that I outsourced...
0
by: Juan | last post by:
Hello: I'm having a trouble making an https request to an URL using c#. If i use an internet navigator, the request works fine and it returns the XML is supposed to return, but if I make it...
3
by: sameergn | last post by:
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...
2
by: jb | last post by:
Hi there, After installing and using MSAJAX 1.0 in one of my servers and websites, sometimes, I get the next error surfing the site: Bad Request (Invalid Verb) Somebody knows what does it...
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...
3
by: m2abhi25 | last post by:
Hi All, I am trying to send an https:// request from my .Net CF application. The code is as follows : try { HttpWebRequest request = ( HttpWebRequest ) ...
0
Sakalicek
by: Sakalicek | last post by:
Hello all, I have serious problem and have no idea how to solve it, of course :) I have Web Service which has master page. This side is the client side. On master page there are some submit...
0
by: ashish | last post by:
Hi , I want to send HTTPs put request to the server .Can any one help me how to do that . I am using this code import httplib from group import *
2
by: Johny | last post by:
If I need to log in to a site using https protocol must I use certification file and key file? The class HTTPSConnection syntax is class HTTPSConnection( host) and I do not know if it is...
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...
0
by: taylorcarr | last post by:
A Canon printer is a smart device known for being advanced, efficient, and reliable. It is designed for home, office, and hybrid workspace use and can also be used for a variety of purposes. However,...
0
by: Charles Arthur | last post by:
How do i turn on java script on a villaon, callus and itel keypad mobile phone
0
by: aa123db | last post by:
Variable and constants Use var or let for variables and const fror constants. Var foo ='bar'; Let foo ='bar';const baz ='bar'; Functions function $name$ ($parameters$) { } ...
0
by: ryjfgjl | last post by:
If we have dozens or hundreds of excel to import into the database, if we use the excel import function provided by database editors such as navicat, it will be extremely tedious and time-consuming...
0
BarryA
by: BarryA | last post by:
What are the essential steps and strategies outlined in the Data Structures and Algorithms (DSA) roadmap for aspiring data scientists? How can individuals effectively utilize this roadmap to progress...
1
by: nemocccc | last post by:
hello, everyone, I want to develop a software for my android phone for daily needs, any suggestions?
0
by: Hystou | last post by:
There are some requirements for setting up RAID: 1. The motherboard and BIOS support RAID configuration. 2. The motherboard has 2 or more available SATA protocol SSD/HDD slots (including MSATA, M.2...
0
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,...
0
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers,...

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.