So, I have this:
item.blade.php
(locaton: 'pages/components/item.blade.php')
<div>
// some php logic
test
</div>
list.blade.php
// some laravel blade logic
<script>
function onAddItem() {
// the code above doesn't work
$.get("visitor.pages.service.html", function(data){
$('#appends').append(data);
});
}
}
</script>
<div>
<button onclick="onAddItem()">add item</button>
<div id="list">
@include('pages.components.item', ['someVars'=> false]); //this displays OK
</div>
</div>
Now what I wanna do is when I click the add item button, it should also add another pages.components.item
template inside list
(id) div.
I already tried the answers on these posts:
But both answers don't work.