Llama explained – Javeline Teleport
—-
—-
Step 1 – A simple form
We start out with an HTML page with a form.
We want to provide some extra assistance with filling out the form. (What is e-mail? I’ve heard the term before, but… :p) We want a button next to the field and when the user clicks on it, a box should show up, giving the user information about that specific field.
Step 2 – Adding the box and buttons
We’ll start with adding the box.
[snip html-source]code/llama-teleport/step2a.html[/snip]
In this case it is a div with in it an image of a llama, the div the message will be put into and a close button. Of course you can leave out the image and simply put the message in the main div. The box is stuck in the lower left corner by some CSS (which can view by downloading the example code).
You’ve might noticed that the close button call function llama_hide(), we need to define this as well as a function to show the box.
[snip js-source]code/llama-teleport/step2b.js[/snip]
Last up is adding the buttons for each of the fields. For now the buttons will simply display an empty box, but we’ll replace that with the RPC call later on.
[snip html-source]code/llama-teleport/step2c.html[/snip]
23 Feb 2007 Arnold Daniels






[...] Well, over time several other protocols were created. A group of people doing a lot of javascript based RPC thought it would be nicer to encode the messages using javascript itself. So they created JSON-RPC. With all the hype around web services the PHP developers felt that this was just bloat. Why not just use REST/POST to get the xml. If you want to call the method getUsers. Just call http://www.example.com/rpc.php?func=getUsers and you are done. No extra protocol needed. In particular for non-enterprise solutions this is a very easy way. [...]
Hi!
I did some playing with your code but I can’t seem to get teleport to pass variables around, or at least more than one. I poked and prodded around the ajax.org and the javelin developer site and couldn’t find the right syntax. I get no errors and the help fields work but my little game engine in ajax (Hammurabi, in honor of one of the very first computer games) doesn’t get the form fields value at all.
You can see the llama_msg.php file at
http://ffproject.net/xfer/llama/hamu_llama_msg.txt
BTW, I hope you don’t mind but I named Hammurabi’s prime minister Mr. Llama in your honor
Hi Renmiri,
Great to hear that you are working with TelePort. I am the developer of that library and Arnold asked me to answer your question. If you look at the following code you will see that it works (if I understood your question correctly that is):
var p1 = document.getElementById(”acresp”).value;
var p2 = document.getElementById(”bushelsd”).value;
var p3 = document.getElementById(”landb”).value;
var p4 = document.getElementById(”lands”).value;
llama_comm.getMessage(’newyear’,p1,p2,p3,p4);
When you type Ctrl-g you will get a debug screen in which you can try this code by pasting it in the ‘Javascript console’ section. If this wasn’t the nature of your problem don’t hesitate to ask me about it. If you wish, please join our mailinglist (http://lists.javeline.net/listinfo/internals) so that everybody can benefit from your questions and the answer to them.
Kind Regards,
Ruben Daniëls
Wooohoo!!!!
Got it to work finally! You should use my mods because it shows how to send mre than one value to the php, plus not only hardcoded msgid but form field values as well, allowing you to do form validation just using javeline teleport. Really cool!!!
http://ffproject.net/xfer/llama/index.html
(Try entering negative values!)
your suggestion worked, thanks!!! try it here
http://ffproject.net/xfer/llama/index.html
Download it here
http://ffproject.net/xfer/llama/hammurabi_ajax.zip
I just gotta say I loved Javeline teleport. This will make my life so much easier!!!