admin管理员组文章数量:1243237
I am doing phonegap app, I want to access web service from server, in coding javascript get,post or ajax methods working fine for http url request but it cant work for https url request. Please help me, how to called SOAP or secure web service to parse JSON in phonegap through javascript?
I am doing phonegap app, I want to access web service from server, in coding javascript get,post or ajax methods working fine for http url request but it cant work for https url request. Please help me, how to called SOAP or secure web service to parse JSON in phonegap through javascript?
Share Improve this question edited Mar 7, 2011 at 10:07 Mayur Birari asked Jun 17, 2010 at 15:26 Mayur BirariMayur Birari 5,8358 gold badges35 silver badges61 bronze badges 1- for https it returning null but in borwser https url working fine,is there any flag in javascript for authentication token – Mayur Birari Commented Jun 17, 2010 at 15:28
3 Answers
Reset to default 9HTTPS is not another protocol, it is merely HTTP over an SSL/TLS- encrypted connection. Since that encryption works transparent to the user agent, to perform a HTTPS AJAX call on your own domain name, your site must be using HTTPS, otherwise you are not able to selectively choose HTTPS on a page you want to perform an AJAX call on that isn't already using HTTPS.
So basically you can't call 'https://yourdomain./fetch' if the page you're calling the AJAX request from isn't using HTTPS.
If you want to perform an AJAX call to a HTTPS domain hosted somewhere else other than your domain, it is somewhat possible to do so (but only in Firefox 3.5+, Safari, Chrome and I think Opera), there is some interesting information about how to make cross-domain AJAX requests possible here: http://metajack.im/2010/01/19/crossdomain-ajax-for-xmpp-http-binding-made-easy/ - this method is not supported in IE (no surprise there).
It is same as every javascript(ajax) function do for phone-gap, in your case its just an invalid certificate issue as per the https server is concern.
If the original loaded page is not connected via https:// then your Ajax calls will not work over https://.
Also Ajax calls must be on the same domain as the main site, as javascript does not allow cross domain Ajax connections.
Also ensure the server side function requested by the Ajax call is returning something other than null.
本文标签: jqueryHow to make an https request in javascriptStack Overflow
版权声明:本文标题:jquery - How to make an https request in javascript? - Stack Overflow 内容由网友自发贡献,该文观点仅代表作者本人, 转载请联系作者并注明出处:http://www.betaflare.com/web/1740131178a2229775.html, 本站仅提供信息存储空间服务,不拥有所有权,不承担相关法律责任。如发现本站有涉嫌抄袭侵权/违法违规的内容,一经查实,本站将立刻删除。
发表评论