1. Add JSONRPC Server

wget http://ftp.drupal.org/files/projects/services-6.x-2.4.tar.gz

tar xvf  services-6.x-2.4.tar.gz

wget http://ftp.drupal.org/files/projects/jsonrpc_server-6.x-1.3.tar.gz

tar xvf  jsonrpc_server-6.x-1.3.tar.gz

2. Call Drupal JSONRPC service with Javascript

<html>
<head>
<title>Drupal JSONRPC Server Test</title>
<script type = "text/javascript" src="jquery-1.5.1.min.js"></script>
</head>
<body>
<script type = "text/javascript">
$(document).ready(
function()
{
$.post(
"http://localhost/kb/services/json-rpc",
{method:
"node.get", params: "[1, []]"},
function(data)
{
alert(data.result.title);
});
});
</script>
</body>
</html>

相关文章:

  • 2021-10-23
  • 2021-05-04
  • 2021-07-24
  • 2021-05-29
  • 2021-07-13
  • 2021-04-08
  • 2021-06-17
猜你喜欢
  • 2021-07-20
  • 2021-12-21
  • 2021-10-08
  • 2021-09-22
  • 2021-09-18
  • 2021-06-10
相关资源
相似解决方案