javascript - Using JQuery to inject an ejs template into html -
can html ejs template injected via jquery? i have index file has navbar , content area, sample testbutton template trying render. index.ejs <ul> . . <li id="listitem"><a href="#test_page">nav bar item</a></li> </ul> <div id="display"> </div> <script> $('#listitem').click( function(){ // note - testbuttontemplate being passed in routes $('#display').html( <%- render( testbuttontemplate, {} ) %> ); }); </script> testbutton.ejs: <a href="#" class="btn btn-primary" id="test-button"> click me! </a> i did best simplify code, basically, when click on link nav bar, want dynamically load page in display div. the nav bar works. click functionality works. if manuallay display ejs template in div, works. ex: <div id="display"> <%- render( testbuttontemp