[Zope] using xml-rpc with javascript to access zope

Jim Washington jwashin at vt.edu
Wed Oct 6 09:58:23 EDT 2004


Laura McCord wrote:

> Hi Chris,
>
> >If not, I'd suggest trying to implement this in very, very small
> pieces.  e.g. make a JavaScript function that does something simple
> like, >calls an XML-RPC method that returns "1+1" and then displays the
> result 2 within the DOM using JavaScript, then build up from there
> >incrementally.
>
> Yes, this is my biggest problem, how do I call a simple xml-rpc method
> from javascript?
>
> The xml-rpc server is not a zope server it is a perl script that is
> running on my local computer.
>
> Ideally this is what I what to do, I want to click on a link and onclick
> will call a javascript function and that function will call a xml-rpc
> method, this will all occur in my zope page template. Sounds basic, but
> I don't know where to start.
>
> I just started learning xml-rpc so I don't know all of the
> technicalities behind it, so I am so sorry for not explaining myself
> correctly before.
>
I have got something similar working.  Go a couple of clicks into 
http://caeep2.edtl.vt.edu/bozquiz , do a couple of questions to see what 
it does, and save the source for review.

All my xmlrpc is going to the same server as the page; this may be the 
only way to make it work due to browser security.  I have not tried to 
do anything different than that.

The vast majority of the javascript is vcxmlrpc.js; right after that is 
the code that links the vcxmlrpc to the methods on the zope server. 

Then, of course, more javascript, css, and finally the html to hang it 
all on.  It's not all really pretty code, but it does the job.

Hope this helps.

-Jim Washington




More information about the Zope mailing list