jQuery rpc

码农软件 · 软件分类 · 其他jQuery插件 · 2020-01-15 09:27:27

软件介绍

The is rpc(remote procedure call) client implementation based on JQuery. It creates an rpc object and adds ability to call them. It supports both xml and json rpc. The datatype support listing is coming soon. It is in early stage. It will not be upgraded if you do not provide feedback . Please take a look at the code and let me know what you think :) .

Synopsis

$.rpc(url, dataType, onLoadCallback, version)

parameters:

url - The url of the rpc server.
dataType - It can be json or xml depending on the rpc server
(optional, default:json).
onLoadCallback - It is the method called when the rpc object is loaded
from server response (optional).
version - The rpc server version (optional).

returns: - The rpc object parsed from the rpc server.

How to use:

After calling the $.rpc(your_server) you can get all the objects and
methods in that server.

var server = $.rpc(your_server_url, "xml");


It may take some time to load the server data. You can assign a load
callback to add task when
the server is loaded. Finally you can call the server functions like this,

// call system.getCapabilities like this
server.system.getCapabilities(function(data){console.log(data)});
// or
server.yourObject.com.your.object.yourMethod(yourParams, callback);


Note that this procedure is asynchronous. And callback functions are
called when a task is done ..

And here is the demo code,

<html>
<head>
       <title>demo</title>
       <!-- Add jquery library -->
       <script src="http://localhost/voip_support/misc/jquery.js"
type="text/javascript"></script>
       <!-- Add rpc plugin -->
       <script src="jquery.rpc.js" type="text/javascript"></script>
       <script>
               $(document).ready(function() {
                       window.rpc_plugins = $.rpc(
                               "xmlrpc.php" /* rpc server */
                               , "xml" /* say that our server is xml */
                               ,function(server) { /* this is
executed when the rpc server is prepared */
                                       /* The rpc server should have
a system object .. */
                                       if(!server || !server.system) {

$("#demo").change("Could not get the rpc object ..");
                                               return;
                                       }
                                       /* show the function list */
                                       var demo = $("#demo");
                                       var func = null;
                                       for(func in server.system) {
                                               demo.append(func + "(),");
                                       }
                               }
                       );
               });
       </script>
</head>
<body>
       <div id="demo">
       </div>
</body>
</html>

The above code will connect to the provided rpc server and list the
methods in system object ..

Please let me know if the above document is helpful. And let me know
if you have any suggestion.

本文地址:https://codercto.com/soft/d/23418.html

P3P Web隐私

P3P Web隐私

克劳娜著、技桥译 / 克劳娜 / 清华大学出版社 / 2004-5 / 45.0

自万维网络中出现商业站点以来,基于Web的商业需求和用户的隐私权利之间就存在着不断的斗争。Web开发者们需要收集有关用户的信息,但是他们也需要表示出对用户隐私的尊重。因此隐私偏好工程平台,或者称之为P3P,就作为满足双方利益的技术应运而生了。 P3P由万维网协会研制,它为Web用户提供了对自己公开信息的更多的控制。支持P3P的Web站点可以为浏览者声明他们的隐私策略。支持P3P的浏览......一起来看看 《P3P Web隐私》 这本书的介绍吧!

CSS 压缩/解压工具
CSS 压缩/解压工具

在线压缩/解压 CSS 代码

HTML 编码/解码
HTML 编码/解码

HTML 编码/解码

html转js在线工具
html转js在线工具

html转js在线工具