您的位置:首页 > 其它

Drupal 学习笔记 (4)

2011-03-22 20:31 246 查看
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>
内容来自用户分享和网络整理,不保证内容的准确性,如有侵权内容,可联系管理员处理 点击这里给我发消息
标签: