Tuesday 11 April 2017

how can i pass a variable from an EJS page to another EJS page

Hello
how can i pass a variable from an EJS page to another EJS page.
For example, I have this page

    // insertion.ejs //




<!DOCTYPE html>
            <html lang=”en”>
            <head></head>
            <header>
                <% include ../views/header %>
            </header>
            <body>
            <script>
            var a="hello";
            </script>
            </body>
        </html>

And this page

 // get.ejs //



        <!DOCTYPE html>
            <html lang=”en”>
            <head></head>
            <header>
                <% include ../views/header %>
            </header>
            <body>
            <script>
            var b 
            </script>
            </body>
         </html>

So how can I pass the content of the variable a to the variable b



via Maki

No comments:

Post a Comment