Want to use the node module querystring
in the .ejs fileAs the title says, how to use the querystring module in the contact.ejs file
Test Results
PHP中文网2017-05-16 13:40:07
console.log
The reason why there is no response is because you are generating code and running it in HTML. JavaScript running in ejs must be wrapped.
I don’t know if you want to run it in ejs or the generated HTML.
If it is ejs:
<% var querystring = require('querystring'); %>
<%= querystring('...') %>
If it is HTML, use it the same way you usually write JavaScript. Either put it on the server and import it through a link or package it into a bundle and import it.