Hi

I am a real beginner with prototype so sorry this is a real beginners
question!

I have a page I want to update dynamically when a link is clicked, and
different content (supplied from a php script) according to which
link. I was thinking to pass the id of the link to the script and use
Ajax.Updater.

So far I have this but it doesn't quite work:

function doSwap(page) {
        new Ajax.Updater('fruit', 'gimme.php', {
        method: 'get', parameters: page=$ });
        return false;
        }

        <div id="fruit">

                <p>Content</p>

        </div>

<a href="#" id="toggle1" onclick="doSwap(); return false;">toggle1
baby</a>
<a href="#" id="toggle2" onclick="doSwap(); return false;">toggle2
baby</a>
<a href="#" id="toggle3" onclick="doSwap(); return false;">toggle3
baby</a>
<a href="#" id="toggle4" onclick="doSwap(); return false;">toggle4
baby</a>





--~--~---------~--~----~------------~-------~--~----~
You received this message because you are subscribed to the Google Groups "Ruby 
on Rails: Spinoffs" group.
To post to this group, send email to rubyonrails-spinoffs@googlegroups.com
To unsubscribe from this group, send email to [EMAIL PROTECTED]
For more options, visit this group at 
http://groups.google.com/group/rubyonrails-spinoffs?hl=en
-~----------~----~----~----~------~----~------~--~---

Reply via email to