Hi,
I have a dynamic page where the user can fill some fields. Those users will all have an account on a WordPress blog. I would like to allow them to directly post the content generated by the webpage to the blog. I don't want to store their password in the server so I want to do this client-side with JQuery.
I have looked both at the standard jQuery.post method and the rpc plugin but I didn't manage to make them work. For example, my latest attempts were something like this:
wprpc = $.rpc('http://blog.wordpress.com/xmlrpc.php', 'xml', callback);
function callback(server) {
answer = server.newPost(0,'user','pass','<struct><title>TestRPC</title></struct>');
alert(answer);
}
and a desperate one:
$.post('http://blogurl.com/xmlrpc.php', { blogid: 0, username: "user", password: "pass", struct: "<struct><title>Test</title></struct>" }, function(data) {alert(data);}, 'xml');
but it silently failed (the callback is not even called).
How would you do this ?