Je veux accéder au web service à travers mon application PhoneGap/android avec xmlhttprequest, mais ce code retourne req.status=401 !!!!
Avez vous une solution pour ce problème?
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN"
"http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<title>PhoneGap</title>
<meta name="viewport" content="width=device-width, initial-scale=1">
<script type="text/javascript" charset="utf-8" src="js/Config/phonegap-0.9.3.js"></script>
<link rel="stylesheet" href="css/jquery/jquery.mobile-1.0a1.min.css" />
<link rel="stylesheet" href="css/Style.css" />
<script src="js/Config/jquery-1.4.3.min.js"></script>
<script src="js/Config/jquery.mobile-1.0a1.min.js"></script>
<script src="jquery.form.js"></script>
<script src="js/Config/jquery-1.7.1.js"></script>
<script src="js/Config/jquery-1.7.1.min.js"></script>
<script language="javascript">
var request = new XMLHttpRequest();
request.open("GET","http://www.patisserie-orient.fr/prestashop/prestashop/api/customers/2",true);
request.onreadystatechange = function() {
alert("Status is :"+request.status);
if (request.status == 200 || request.status == 0){
response = request.responseXML.documentElement;
itemDescription = response.getElementsByTagName('lastname')[0].firstChild.data;
alert ( itemDescription );
}
}
request.send();
</script>
</head>
<body>
<div id="dropdownlist" />
</body>
</html>
Avez vous une solution pour ce problème?