Drupal 学习笔记 (3)

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 Testtitle>
<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>
请使用浏览器的分享功能分享到微信等