Giter Site home page Giter Site logo

learnejs's Introduction

learnEJS

This project will help a person understand the working of EJS (Embedded JavaScript).

###Views

View is the webpage that will be served to the client, it can be static/dynamic. The server, when requested with a particular route, it serves the view along with data according to request.

This repository contains the following views which are stroed in views folder

###New Views(In Progress)

###Instructions for Installation

  • Clone this repo
  • Install Node.js from here
  • Install Dependencies npm install
  • Run the server npm start
  • Goto localhost:3000

###Example

Suppose this object { "Name":"David Bowie", "Songs":["Man who sold the world", "Starman", "Space Oddity"] } is provided by the server to a particular view, and this data is to be displayed on the page which is requested by the client, then the view will include the following lines of code-

  1. <%= key %> - will result in rendering the value of key (property of the object defined above).
<%= Name %> - In this case it will be `David Bowie`
  1. <% %> - will execute as normal javascript.

    For displaying the list of Songs -

    <%  for(var i=0; i<Songs.length; i++){  %>
        <%= Songs[i]  %>
    <%  } %>    
    

For documentation on EJS goto this site -> http://embeddedjs.com/

learnejs's People

Contributors

anishsingh20 avatar ankursarode avatar hvarday avatar umang18oct avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar

Forkers

rahulakrishna

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.