| Page 1 of 1 | [ 5 posts ] |
|
Hi,
I'm new to YUI and I'm finding it hard to understand. I'm trying to emulate youtubes inbox/comment system where you click a link and it produces the message using ajax. The trouble I'm having is assigning the onclick event to each message subject. |
|
What have you tried so far? Specifically:
- How are you attaching the event listeners? - How are you calling io to retrieve data? Let's see with what you have, currently, and where are you having difficulties. Regards, Thomas |
|
At the moment I'm using ajax code from w3schools, I have used the yui to post data from a form ok. What I'm really looking for is an example of retrieving data from a get call from several (2 would do) links.
Thanks for replying. |
|
<script>
YUI().use("io-form", function(Y) { function postcomment() { alert(args); Y.io('./cms/getcontactinfo.php?id='+id); Y.on('io:success', onSuccess, this); Y.on('io:failure', onFailure, this); }; function onSuccess(id,response,args) { alert(response.responseText); }; function onFailure(id,response,args) { alert("Error, retry..."); }; Y.on('click', postcomment, '#contact_click_me', this, true); }); </script> |
|
|
| Page 1 of 1 | [ 5 posts ] |
| You cannot post new topics in this forum You cannot reply to topics in this forum You cannot edit your posts in this forum You cannot delete your posts in this forum |
© 2006-2013 Yahoo! Inc. All rights reserved.
All code on this site is licensed under the BSD License unless stated otherwise.
About This Site · Security Contact Info
Powered by phpBB® Forum Software © phpBB Group