Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- function do_links(links) {
- for (var i = 0, n = links.length; i < n; ++i) {
- link_prepare(links[i]);
- }
- }
- function link_prepare(link) {
- if (link.prepared) return;
- $(link).observe('click', function (e) {
- var dasLink = Event.findElement(e);
- console.log('Link', link); // si tu as toujours le même lien = problème de closure :P
- new Ajax.Updater('dMain', link.href, {
- onComplete: function(response) {
- // Handle the response content...
- do_links($('dMain').select('a'));
- }
- });
- e.stop(); // == return false sur le onclick();
- });
- link.prepared = true;
- }
- function my_onload() {
- do_links($$('a'));
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement