I wrote my own JavaScript function inside an ejs file which I want to use it inside that file. The problem is that it is not working because the function is declared to be undefined . I have declared that function inside the ejs file as illustrated below.
//my ejs file
<script> 
        function c_tab (){
            //codes...
            return "data";
         }
    </script>
</head>
<body>
    <h1>WELCOME  TO  E J S </h1>
     <p>Ok this willrecievedata from server ... <%=  c_tab(); %> 
    </p>
The error report says that c_tab is not defined
So how to use a user defined javascript function inside ejs file .
 
     
     
    