Answers for "using server passed values and client js together in ejs"

-1

using server passed values and client js together in ejs

<% var test = 101; %> // variable created by ejs
 <script>
   var getTest = <%= test  %>;  //var test is now assigned to getTest which will only work on browsers
   console.log(getTest);  // successfully prints 101 on browser
</script>
Posted by: Guest on May-25-2020

Code answers related to "using server passed values and client js together in ejs"

Code answers related to "Javascript"

Browse Popular Code Answers by Language