lundi 18 février 2019

Including laravel blade template with button click

I can not find a solution how to include blade template using button click.

For example lets say I have a main view:

<div id="HEREGOESMYTEMPLATES">
</div>
<div class="row"> 
    <button onclick="addTemplate()">ADD TEMPLATE</button>
</div>

Then script, which should include template

<script type="app/js">
  function addTemplate()
    {
       //Get template and include into div with id HEREGOESMYTEMPLATE
    }

</script>

And then the template itself (lets say partial.blade.php):

 <div>Include me to main blade file</div>

Is there any possible way by including it without creating every tag in JS and then appending to the div?

Thank you.



via Chebli Mohamed

Aucun commentaire:

Enregistrer un commentaire