eldarion / eldarion-ajax

a library for adding declarative ajax functionality to your website
BSD 3-Clause "New" or "Revised" License
758 stars 153 forks source link

Support multiple refresh elements #22

Closed MauMaGau closed 11 years ago

MauMaGau commented 11 years ago

Enable multiple elements to refresh by using data-refresh=".ele1, ele2" Something like:

if (refresh_selector) {
        refresh_selector = refresh_selector.split(',');
        $.each($(refresh_selector), function(index, value) {
          $.getJSON($(value).data('refresh-url'), function(data) {
            $(value).replaceWith(data.html)
          })
        })
      }
paltman commented 11 years ago

@MauMaGau I don't think this is a necessary. jQuery supports doing $('.some-class,#some-id,element') to select different things in one go.

MauMaGau commented 11 years ago

Oh awesome, so it does! My bad, thanks :)