```coffeescript
RunLoop.register ->
  for el in $('[data-replace-self-on-load]')
    url = $(el).data('replace-self-on-load')
    $(el).removeAttr('data-replace-self-on-load').trigger('replace:success')
    window.fetchAndReplace(el, url)
```

Fix replace self on load function
user
```coffeescript
RunLoop.register ->
  for el in $('[data-replace-self-on-load]')
    url = $(el).data('replace-self-on-load')
    window.fetchAndReplace el, url, (newEl) =>
      $(newEl).trigger('replace:success')
```
assistant