Search
 
SCRIPT & CODE EXAMPLE
 
CODE EXAMPLE FOR JAVASCRIPT

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>
Source by stackoverflow.com #
 
PREVIOUS NEXT
Tagged: #server #passed #values #client #js #ejs
ADD COMMENT
Topic
Name
6+5 =