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

Handlers do not work if html is empty string #54

Closed shabda closed 11 years ago

shabda commented 11 years ago

To replicate:

return this (after) jsoning

`data = {"html": ""} from a view.

Html is:

<a href="/foo/" class="ajax" data-replace="#some-id">

The object doesn't get replaced.

Easy to work around by adding a space in returned html, but hard to debug if you hit this issue.

`data = {"html": ""}

paltman commented 11 years ago

@shabda: Are you sure you want to remove the DOM element or just set the inside of the element to blank?

shabda commented 11 years ago

@paltman : Yeah we could just use data-remove in this cases. Should have read the docs a little more.