# Load ajax content with reserved data attributes

**URL:** https://discuss.hotwired.dev/t/load-ajax-content-with-reserved-data-attributes/103
**Category:** General
**Created:** [February 17, 2018, 9:35am UTC](https://discuss.hotwired.dev/t/load-ajax-content-with-reserved-data-attributes/103 "2018-02-17T09:35:07Z")
**Posts on this page:** 3
**Page:** 1

<div class="post-metadata">

### Author: ![helio-correia](https://yyz1.discourse-cdn.com/flex027/user_avatar/discuss.hotwired.dev/helio-correia/32/79_2.png) [@helio-correia](https://discuss.hotwired.dev/u/helio-correia)
#### Post date: [February 17, 2018, 9:35am UTC](https://discuss.hotwired.dev/t/load-ajax-content-with-reserved-data-attributes/103/1 "2018-02-17T09:35:07Z")

</div>

Hi, great framework by the way. I’m trying to explore a bit by doing a todo list and i’m trying to create the template in js by adding this on load.

I’m getting this error because the data-action is reserved  
index.ts:33 Error parsing descriptor string “task”

Error: Bad action descriptor “task”: Invalid action descriptor syntax

The code is this:

```
connect() {
$.getJSON('/tasks/', (data) => {
    $.each( JSON.parse(data), ( key, instance ) => {
        $("<li/>", {
            'data-action': 'task#change',
            id: key,
            text: instance.fields.name
        }).appendTo($(this.element))
    });
})

```

}

How can i do something like this?

---

<div class="post-metadata">

### Author: ![sam](https://yyz1.discourse-cdn.com/flex027/user_avatar/discuss.hotwired.dev/sam/32/1091_2.png) [@sam](https://discuss.hotwired.dev/u/sam)
#### Post date: [February 17, 2018, 3:07pm UTC](https://discuss.hotwired.dev/t/load-ajax-content-with-reserved-data-attributes/103/2 "2018-02-17T15:07:41Z")

</div>

You’ll need to specify an event name in your action descriptor:

```
'data-action': 'click->task#change’,
                ^^^^^^^

```

because Stimulus doesn’t define a default event for actions on `<li>` elements.

You can see a [full list of default events](https://stimulusjs.org/handbook/building-something-real#common-events-have-a-shorthand-action-notation) in the Stimulus handbook.

(I’m sorry the error message you received isn’t more helpful!)

---

<div class="post-metadata">

### Author: ![helio-correia](https://yyz1.discourse-cdn.com/flex027/user_avatar/discuss.hotwired.dev/helio-correia/32/79_2.png) [@helio-correia](https://discuss.hotwired.dev/u/helio-correia)
#### Post date: [February 17, 2018, 7:14pm UTC](https://discuss.hotwired.dev/t/load-ajax-content-with-reserved-data-attributes/103/3 "2018-02-17T19:14:32Z")

</div>

Oh it was my mistake, thanks for the reply and no problem for the message not be so useful. It’s still the 1.0 and I am really enjoying the package.
