So I'm building up a frontend example:
<!DOCTYPE html>
<html lang="de">
<head>
<title>jQuery Beispiel: einbinden und erster Befehl </title>
<script type="text/javascript" src="jquery-2.1.1.min.js"></script>
<script type="text/javascript" src="orientdb-js.min.js"></script>
<script type="text/javascript">
$(document).ready(function(){
$('.searchTitle').on('input', function() {
$.ajax({url:"http://localhost:2480/function/test/test/ss",
name:"admin",
password:"admin",
type: 'POST',
crossDomain: true,
dataType: 'jsonp',
error: function() { alert('Failed!'); },
success:function(result){
console.log(result);
}});
});
});
</script>
</head>
<body>
<p>Vorname:<br><input name="searchTitle" class="searchTitle" type="text"
size="30" maxlength="30"></p>
<div class="listOfTitle"></div>
</body>
</html>
but when I now type in something I'm getting the pop-up from my browser
(Firefox/Chrome).
So when I now type in there admin, admin it works and I get the result
back. So there is a problem with the basic auth and ajax.
Btw if I do the same with curl:
$service_url = 'http://localhost:2480/function/test/test/coolertitle';
$curl = curl_init($service_url);
curl_setopt($curl, CURLOPT_RETURNTRANSFER, true);
curl_setopt($curl, CURLOPT_POST, true);
curl_setopt($curl, CURLOPT_USERPWD, "admin:admin");
$curl_response = curl_exec($curl);
curl_close($curl);
echo $curl_response;
It works great. So somehow ajax is not working or I'm using it wrong?
Thank you for any help.
--
---
You received this message because you are subscribed to the Google Groups
"OrientDB" group.
To unsubscribe from this group and stop receiving emails from it, send an email
to [email protected].
For more options, visit https://groups.google.com/d/optout.