Welcome to OStack Knowledge Sharing Community for programmer and developer-Open, Learning and Share
Welcome To Ask or Share your Answers For Others

Categories

0 votes
430 views
in Technique[技术] by (71.8m points)

html - How do I include the navbar, partials, jumbotron and footer in the ejs?

I want to include my already working navbar, partials, jumbotron and footer in my login.ejs.

For my other ejs files it worked perfectly, but for some reason not in my login.ejs.

Here's my code for the login.ejs:

<!DOCTYPE html>
<html lang="en">

<head>
    <meta charset="UTF-8">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <title>Login</title>
    
</head>

<body>
    <h1>Login!</h1>
    <form action="/login" method="POST">
        <div>
            <label for="username">Enter Username</label>
            <input type="text" name="username" id="username" placeholder="username">
        </div>
        <div>
            <label for="password">Enter Password</label>
            <input type="password" name="password" id="password" placeholder="password">
        </div>
        <button>Login</button>
    </form>

</body>

</html>

And I want to include:

<%- include("partials/head")%>

<%- include("partials/nav")%>

<div style="margin-top: 55px;"></div>


<%- include("partials/footer")%>
question from:https://stackoverflow.com/questions/65934299/how-do-i-include-the-navbar-partials-jumbotron-and-footer-in-the-ejs

与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…
Welcome To Ask or Share your Answers For Others

1 Answer

0 votes
by (71.8m points)
Waitting for answers

与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…
Welcome to OStack Knowledge Sharing Community for programmer and developer-Open, Learning and Share
Click Here to Ask a Question

...