I would like to execute a code inside an html element after an xhr request
I used to used JQUERY $(el).html(data)
and that worked just fine
Now trying to get rid of jquery
I tried both vanilla JS innerHTML
and vue3 v-html
but the script never executes
I can see it in html
Here is the code:
axios.get('/getAarea/blog')
.then(response => {
const data = response.data;
if (!data.report) {
const el = $("#ContentUserPanel")
el.html(data)
this.loading = false
this.selected = this.types.blogs
this.toggleUserMobileMenu()
} else {
Error('There was an error ',data.report)
this.loading = false
this.selected = null
}
})
.catch(err => {
Error('There was an error ',err)
this.loading = false
this.selected = null
});
Could someone explain ?