Copied to clipboard

Flag this post as spam?

This post will be reported to the moderators as potential spam to be looked at


  • kyle 49 posts 240 karma points
    Jan 17, 2022 @ 04:35
    kyle
    0

    How to render partial view with vanilla js?

    Hi, everyone!

    I need help rendering a Umbraco partial view from javascript, and I need to do it in plain, vanilla javascript, not jquery...

    I want to render a specific partial view based on button click, my structure simplified:

     <button id="btn-one">btn one</button>
     <button id="btn-two">btn two</button>
    
        <div class="display-area">
    
       The specific view must render here on btn click
    
        </div>
    

    then I want to do something like this...

    var btnOne = document.getElementById("btn-one");
    btnOne.addEventListener('click', function ()  {
    
    then here, render partial view one in display area...?
    
    });
    

    I found a solution in jquery, but please help me do this in normal js...

    Thank you in advance!

Please Sign in or register to post replies

Write your reply to:

Draft