Why doesn't my connection to neo4j work (through Javascript) -
i trying make interaction local neo4j dataset through javascript. error:
uncaught syntaxerror: unexpected token : (13:20:43:754 | error, javascript) @ http://localhost:7474/?callback=jquery111107695061936974525_1417522841327&{%22statements%22:[{%22statement%22:%22match%20(n)%20return%20count(n)%22}]}&_=1417522841328:2 success (13:20:43:958) @ public_html/index.html:34
i.e. want sent , receive queries web application. code now:
<head> <title>todo supply title</title> <meta charset="utf-8"> <meta name="viewport" content="width=device-width, initial-scale=1.0"> <script language="javascript" type="text/javascript" src="js/jquery-1.11.1.js"></script> <script type="text/javascript"> var body = json.stringify({ statements: [{ statement: 'match (n) return count(n)' }] }); $.ajax({ url: "http://localhost:7474", type: "post", data: body, datatype: "jsonp", contenttype: "application/jsonp" }) .done(function(result){ console.log(result); }) .fail(function(error){ console.log(error.statustext); }); </script> </head>
it's not working because you're posting wrong endpoint. note url
it should this:
$.ajax({ url: "http://localhost:7474/db/data/transaction/commit", type: "post", data: body, datatype: "jsonp", contenttype: "application/jsonp" })
Comments
Post a Comment