[EMAIL PROTECTED] schrieb:
I'm having a hard time wrapping my head around MochiKit, because I have
very little javascript experience.
I want to do something really simple. When I click a specific link on
a page, I want some text to appear in the middle of the page.
I understand enough that I need to put something in my page that will
be replaced with the text
So far I have:
<div id="infotarget">
</div>
in my html body to hold the text that I want put in there.
But I'm having trouble coming up with the javascript function with
mochikit that will put the text there!
Can someone please take pity on me, and give me a simple example as to
how to do this?
You need something like this:
<script>
function setup() {
MochiKit.Signal.connect(getElement('the_link'), 'onclick',
function(event) {
var target = getElement('infotarget');
target.innerHTML = 'lalalal';
});
}
MochiKit.Signal.connect(window, 'onload', setup);
</script>
--~--~---------~--~----~------------~-------~--~----~
You received this message because you are subscribed to the Google Groups
"TurboGears" group.
To post to this group, send email to [email protected]
To unsubscribe from this group, send email to [EMAIL PROTECTED]
For more options, visit this group at
http://groups.google.com/group/turbogears?hl=en
-~----------~----~----~----~------~----~------~--~---