D-3 another easy method for loop array.forEach and the anonymous function inside fun we usually use the singular of the array posts.forEach(function(post){ console.log(post); }) #js #100DaysOfCode
D-2 passing specific array data from js to ejs 1.local array var in js var b= []; to add more [] use .push() use for loop inside ejs <% for loop >% and pass data in console.log *posts[i].title #js #100DaysOfCode
D-2 how to use res.render vs res.redirect redirect forced navigation to a different URL and should never be part of any standard rendering process #js #100DaysOfCode
D-2 input for one line textarea used for multi line input in html we used label to named the input section label + textarea inside div become perfect UI #javascript #100DaysOfCode
D-2 pass date html to server <form action="/compose" method="post"><input type="text" name="textCompose"><button type="submit" name="button">Publish</button></form> server side app.post("/compose",function(req,res){c.log(req.body.textCompose); })#100DaysOfCode
how to use modules with js 1- create new file 2- declarer that file in the main app.js const date = require(__dirname+"/date.js"); 3- now you can use it const day = date.getDate(); #100dayscoding #100daysofcodechallenge
United States 趨勢
- 1. #ProofOfFortification 1,998 posts
- 2. Good Sunday 41.7K posts
- 3. Pico Prism 4,144 posts
- 4. Stanford 11.7K posts
- 5. SPENCER SMITH 1,154 posts
- 6. Norvell 4,444 posts
- 7. Florida State 10.6K posts
- 8. Brendon 6,520 posts
- 9. #AEWWrestleDream 72.2K posts
- 10. Sabrina 71.9K posts
- 11. Manchester United 43.3K posts
- 12. Lott 1,034 posts
- 13. lorde 7,467 posts
- 14. José Gregorio Hernández 44.1K posts
- 15. Shatta Wale 42.9K posts
- 16. Woodstock 3,205 posts
- 17. Darby 12K posts
- 18. Vaticano 40.5K posts
- 19. Talus Labs 13.5K posts
- 20. Castellanos 3,509 posts
Something went wrong.
Something went wrong.