开发者

XMLRPC call from jQuery or JavaScript

I have a HTML file with little bit of javascript in it. Its not in any server. I have that file on my desktop. I have enabled the services module and want to do stuff from 开发者_高级运维the HTML file.

$.post(
"http://example.com/services/xmlrpc",
{methodName: node.load; nid: 1},
function(data){
alert("Data: " + data);
}
);

Now, as far as I know, it will work. BUT, when I put (upload) the same HTML file in my android phone, will it work??

Please show some light in this!

Thanks


If the reponse is an object - I advise to use Firebug extension in Firefox and the Console tab where You can see what the response looks like (I suppose it will be encoded to JSON) - it should look like {"property":"value", "property2":"value2", ...}. Then You can acces the properties like

$.post(
    "http://example.com/services/xmlrpc",
        {methodName: node.load; nid: 1},
        function(data){
            alert("Property 1: " + data.property);
        }
);
0

上一篇:

下一篇:

精彩评论

暂无评论...
验证码 换一张
取 消

最新问答

问答排行榜