tags:

views:

32

answers:

1

i wanna call the different file on click on hyper link but using mootools ajax it's not made possible through my way so give our suggestion

A: 

It's all in the documentation:

Request: http://mootools.net/docs/core/Request/Request.HTML

Event handling: http://mootools.net/docs/core/Native/Event

<a href="some-file-1.html">Lipsum</a>
<a href="some-file-2.html">Lipsum</a>

MooTools:

$$('a').each(function(link){
  var linkHref = link.get('href');

  link.addEvents({
    click: function(e){
      e.stop();

      new Request.HTML({
        url: linkHref,
        update: $('element-to-update')
      }).send();
    }
  });
});
Oskar Krawczyk